original_string: public function createDocument(
          array $properties,
          StreamInterface $contentStream,
          VersioningState $versioningState,
          array $policies = [],
          array $addAces = [],
          array $removeAces = [],
          OperationContextInterface $context = null
      ) {
          $newObjectId = $this->getSession()->createDocument(
              $properties,
              $this,
              $contentStream,
              $versioningState,
              $policies,
              $addAces,
              $removeAces
          );
  
          $document = $this->getNewlyCreatedObject($newObjectId, $context);
  
          if ($document === null) {
              return null;
          } elseif (!$document instanceof DocumentInterface) {
              throw new CmisRuntimeException('Newly created object is not a document! New id: ' . $document->getId());
          }
  
          return $document;
      }
code: public function createDocument(
          array $properties,
          StreamInterface $contentStream,
          VersioningState $versioningState,
          array $policies = [],
          array $addAces = [],
          array $removeAces = [],
          OperationContextInterface $context = null
      ) {
          $newObjectId = $this->getSession()->createDocument(
              $properties,
              $this,
              $contentStream,
              $versioningState,
              $policies,
              $addAces,
              $removeAces
          );
  
          $document = $this->getNewlyCreatedObject($newObjectId, $context);
  
          if ($document === null) {
              return null;
          } elseif (!$document instanceof DocumentInterface) {
              throw new CmisRuntimeException('Newly created object is not a document! New id: ' . $document->getId());
          }
  
          return $document;
      }
code_tokens: public function createDocument ( array $ properties , StreamInterface $ contentStream , VersioningState $ versioningState , array $ policies = [ ] , array $ addAces = [ ] , array $ removeAces = [ ] , OperationContextInterface $ context = null ) { $ newObjectId = $ this -> getSession ( ) -> createDocument ( $ properties , $ this , $ contentStream , $ versioningState , $ policies , $ addAces , $ removeAces ) ; $ document = $ this -> getNewlyCreatedObject ( $ newObjectId , $ context ) ; if ( $ document === null ) { return null ; } elseif ( ! $ document instanceof DocumentInterface ) { throw new CmisRuntimeException ( 'Newly created object is not a document! New id: ' . $ document -> getId ( ) ) ; } return $ document ; }
docstring: Creates a new document in this folder.
  
  @param array $properties The property values that MUST be applied to the object. The array key is the property
  name the value is the property value.
  @param StreamInterface $contentStream
  @param VersioningState $versioningState An enumeration specifying what the versioning state of the newly-created
  object MUST be. Valid values are:
  <code>none</code>
  (default, if the object-type is not versionable) The document MUST be created as a non-versionable
  document.
  <code>checkedout</code>
  The document MUST be created in the checked-out state. The checked-out document MAY be
  visible to other users.
  <code>major</code>
  (default, if the object-type is versionable) The document MUST be created as a major version.
  <code>minor</code>
  The document MUST be created as a minor version.
  @param PolicyInterface[] $policies A list of policy ids that MUST be applied to the newly-created document
  object.
  @param AceInterface[] $addAces A list of ACEs that MUST be added to the newly-created document object, either
  using the ACL from folderId if specified, or being applied if no folderId is specified.
  @param AceInterface[] $removeAces A list of ACEs that MUST be removed from the newly-created document object,
  either using the ACL from folderId if specified, or being ignored if no folderId is specified.
  @param OperationContextInterface|null $context
  @return DocumentInterface|null the new folder object or <code>null</code> if the parameter <code>context</code>
  was set to <code>null</code>
  @throws CmisRuntimeException Exception is thrown if the created object is not a document
docstring_tokens: Creates a new document in this folder .