diff --git a/composer.json b/composer.json index 50bdc70a..58ceb177 100644 --- a/composer.json +++ b/composer.json @@ -34,7 +34,7 @@ "symfony/filesystem": "^2.7 || ^3 || ^4", "ramsey/uuid": "^3.7", "doctrine/annotations": "^1.6", - "zendframework/zend-code": "^3.3.1", + "zendframework/zend-code": "^3.4", "psr/container": "^1", "ext-PDO": "*", "ext-json": "*", diff --git a/src/QueryFactory/FindObjectsFromRawSqlQueryFactory.php b/src/QueryFactory/FindObjectsFromRawSqlQueryFactory.php index 71c0c508..58d78045 100644 --- a/src/QueryFactory/FindObjectsFromRawSqlQueryFactory.php +++ b/src/QueryFactory/FindObjectsFromRawSqlQueryFactory.php @@ -3,6 +3,7 @@ namespace TheCodingMachine\TDBM\QueryFactory; +use Doctrine\Common\Cache\Cache; use Doctrine\DBAL\Platforms\MySqlPlatform; use Doctrine\DBAL\Schema\Schema; use TheCodingMachine\TDBM\TDBMException; @@ -39,20 +40,17 @@ class FindObjectsFromRawSqlQueryFactory implements QueryFactory * @var string */ private $mainTable; - /** - * FindObjectsFromRawSqlQueryFactory constructor. - * @param TDBMService $tdbmService - * @param Schema $schema - * @param string $mainTable - * @param string $sql - * @param string $sqlCount + * @var Cache */ - public function __construct(TDBMService $tdbmService, Schema $schema, string $mainTable, string $sql, string $sqlCount = null) + private $cache; + + public function __construct(TDBMService $tdbmService, Schema $schema, string $mainTable, string $sql, ?string $sqlCount, Cache $cache) { $this->tdbmService = $tdbmService; $this->schema = $schema; $this->mainTable = $mainTable; + $this->cache = $cache; [$this->processedSql, $this->processedSqlCount, $this->columnDescriptors] = $this->compute($sql, $sqlCount); } @@ -85,6 +83,10 @@ public function getColumnDescriptors(): array */ private function compute(string $sql, ?string $sqlCount): array { + $key = 'FindObjectsFromRawSqlQueryFactory_' . dechex(crc32(var_export($sqlCount, true) . $sql)); + if ($this->cache->contains($key)) { + return $this->cache->fetch($key); + } $parser = new PHPSQLParser(); $parsedSql = $parser->parse($sql); @@ -95,7 +97,7 @@ private function compute(string $sql, ?string $sqlCount): array } else { throw new TDBMException('Unable to analyze query "'.$sql.'"'); } - + $this->cache->save($key, [$processedSql, $processedSqlCount, $columnDescriptors]); return [$processedSql, $processedSqlCount, $columnDescriptors]; } diff --git a/src/QueryFactory/FindObjectsFromSqlQueryFactory.php b/src/QueryFactory/FindObjectsFromSqlQueryFactory.php index f178da1e..6fd7b619 100644 --- a/src/QueryFactory/FindObjectsFromSqlQueryFactory.php +++ b/src/QueryFactory/FindObjectsFromSqlQueryFactory.php @@ -36,6 +36,17 @@ public function __construct(string $mainTable, string $from, $filterString, $ord protected function compute(): void { + $key = 'FindObjectsFromSqlQueryFactory_' . dechex(crc32($this->mainTable.'__'.$this->from.'__'.$this->filterString.'__'.$this->orderBy)); + if ($this->cache->contains($key)) { + [ + $this->magicSql, + $this->magicSqlCount, + $this->magicSqlSubQuery, + $this->columnDescList + ] = $this->cache->fetch($key); + return; + } + // We quote in MySQL because of MagicQuery that will be applied. $mySqlPlatform = new MySqlPlatform(); @@ -104,6 +115,13 @@ protected function compute(): void $this->magicSqlCount = $countSql; $this->magicSqlSubQuery = $subQuery; $this->columnDescList = $columnDescList; + + $this->cache->save($key, [ + $this->magicSql, + $this->magicSqlCount, + $this->magicSqlSubQuery, + $this->columnDescList, + ]); } /** @@ -161,12 +179,10 @@ private function getChildrenRelationshipForeignKeysWithoutCache(string $tableNam return $this->getChildrenRelationshipForeignKeys($fk->getLocalTableName()); }, $children); - $fks = array_merge($children, call_user_func_array('array_merge', $fksTables)); - - return $fks; - } else { - return []; + return array_merge($children, ...$fksTables); } + + return []; } /** diff --git a/src/TDBMService.php b/src/TDBMService.php index dbf387ab..2d9bc44f 100644 --- a/src/TDBMService.php +++ b/src/TDBMService.php @@ -23,7 +23,6 @@ use Doctrine\Common\Cache\Cache; use Doctrine\Common\Cache\ClearableCache; -use Doctrine\Common\Cache\VoidCache; use Doctrine\DBAL\Connection; use Doctrine\DBAL\DBALException; use Doctrine\DBAL\Platforms\AbstractPlatform; @@ -1083,9 +1082,11 @@ private function exploreChildrenTablesRelationships(SchemaAnalyzer $schemaAnalyz $tables = [$table]; $keys = $schemaAnalyzer->getChildrenRelationships($table); + $tmpTables = []; foreach ($keys as $key) { - $tables = array_merge($tables, $this->exploreChildrenTablesRelationships($schemaAnalyzer, $key->getLocalTableName())); + $tmpTables[] = $this->exploreChildrenTablesRelationships($schemaAnalyzer, $key->getLocalTableName()); } + $tables = array_merge($tables, ...$tmpTables); return $tables; } @@ -1349,7 +1350,7 @@ public function findObjectsFromRawSql(string $mainTable, string $sql, array $par $mode = $mode ?: $this->mode; - $queryFactory = new FindObjectsFromRawSqlQueryFactory($this, $this->tdbmSchemaAnalyzer->getSchema(), $mainTable, $sql, $sqlCount); + $queryFactory = new FindObjectsFromRawSqlQueryFactory($this, $this->tdbmSchemaAnalyzer->getSchema(), $mainTable, $sql, $sqlCount, $this->cache); return $resultIteratorClass::createResultIterator($queryFactory, $parameters, $this->objectStorage, $className, $this, $this->magicQuery, $mode, $this->logger); } diff --git a/src/Utils/BeanDescriptor.php b/src/Utils/BeanDescriptor.php index abbd1f79..74856380 100644 --- a/src/Utils/BeanDescriptor.php +++ b/src/Utils/BeanDescriptor.php @@ -361,8 +361,9 @@ private function generateBeanConstructor() : MethodGenerator $constructorProperties = $this->getConstructorProperties(); $constructor = new MethodGenerator('__construct', [], MethodGenerator::FLAG_PUBLIC); - $constructor->setDocBlock('The constructor takes all compulsory arguments.'); - $constructor->getDocBlock()->setWordWrap(false); + $constructorDocBlock = new DocBlockGenerator('The constructor takes all compulsory arguments.'); + $constructorDocBlock->setWordWrap(false); + $constructor->setDocBlock($constructorDocBlock); $assigns = []; $parentConstructorArguments = []; @@ -374,7 +375,7 @@ private function generateBeanConstructor() : MethodGenerator } $constructor->setParameter($parameter); - $constructor->getDocBlock()->setTag($property->getParamAnnotation()); + $constructorDocBlock->setTag($property->getParamAnnotation()); if ($property->getTable()->getName() === $this->table->getName()) { $assigns[] = $property->getConstructorAssignCode()."\n"; @@ -487,9 +488,14 @@ public function generateJsonSerialize(): MethodGenerator $parentFk = $this->schemaAnalyzer->getParentRelationship($tableName); $method = new MethodGenerator('jsonSerialize'); - $method->setDocBlock('Serializes the object for JSON encoding.'); - $method->getDocBlock()->setTag(new ParamTag('$stopRecursion', ['bool'], 'Parameter used internally by TDBM to stop embedded objects from embedding other objects.')); - $method->getDocBlock()->setTag(new ReturnTag(['array'])); + $method->setDocBlock(new DocBlockGenerator( + 'Serializes the object for JSON encoding.', + null, + [ + new ParamTag('$stopRecursion', ['bool'], 'Parameter used internally by TDBM to stop embedded objects from embedding other objects.'), + new ReturnTag(['array']) + ] + )); $method->setParameter(new ParameterGenerator('stopRecursion', 'bool', false)); if ($parentFk !== null) { @@ -1409,8 +1415,11 @@ private function generateGetUsedTablesCode(): MethodGenerator } $method = new MethodGenerator('getUsedTables'); - $method->setDocBlock('Returns an array of used tables by this bean (from parent to child relationship).'); - $method->getDocBlock()->setTag(new ReturnTag(['string[]'])); + $method->setDocBlock(new DocBlockGenerator( + 'Returns an array of used tables by this bean (from parent to child relationship).', + null, + [new ReturnTag(['string[]'])] + )); $method->setReturnType('array'); $method->setBody($code); @@ -1433,7 +1442,7 @@ private function generateOnDeleteCode(): ?MethodGenerator } $method = new MethodGenerator('onDelete'); - $method->setDocBlock('Method called when the bean is removed from database.'); + $method->setDocBlock(new DocBlockGenerator('Method called when the bean is removed from database.')); $method->setReturnType('void'); $method->setBody('parent::onDelete(); '.$code); @@ -1453,8 +1462,11 @@ private function generateGetManyToManyRelationshipDescriptorCode(array $pivotTab $method = new MethodGenerator('_getManyToManyRelationshipDescriptor'); $method->setVisibility(AbstractMemberGenerator::VISIBILITY_PUBLIC); - $method->setDocBlock('Get the paths used for many to many relationships methods.'); - $method->getDocBlock()->setTag(new GenericTag('internal')); + $method->setDocBlock(new DocBlockGenerator( + 'Get the paths used for many to many relationships methods.', + null, + [new GenericTag('internal')] + )); $method->setReturnType(ManyToManyRelationshipPathDescriptor::class); $parameter = new ParameterGenerator('pathKey'); @@ -1488,9 +1500,11 @@ private function generateGetManyToManyRelationshipDescriptorKeysCode(array $pivo $method = new MethodGenerator('_getManyToManyRelationshipDescriptorKeys'); $method->setVisibility(AbstractMemberGenerator::VISIBILITY_PUBLIC); $method->setReturnType('array'); - $method->setDocBlock('Returns the list of keys supported for many to many relationships'); - $method->getDocBlock()->setTag(new GenericTag('internal')); - $method->getDocBlock()->setTag(new ReturnTag('string[]')); + $method->setDocBlock(new DocBlockGenerator( + 'Returns the list of keys supported for many to many relationships', + null, + [new GenericTag('internal'), new ReturnTag('string[]')] + )); $keys = []; foreach ($pivotTableMethodsDescriptors as $pivotTableMethodsDescriptor) { @@ -1664,7 +1678,7 @@ private function generateGetForeignKeys(array $fks): MethodGenerator $method = new MethodGenerator('getForeignKeys'); $method->setVisibility(AbstractMemberGenerator::VISIBILITY_PROTECTED); $method->setStatic(true); - $method->setDocBlock('Internal method used to retrieve the list of foreign keys attached to this bean.'); + $method->setDocBlock(new DocBlockGenerator('Internal method used to retrieve the list of foreign keys attached to this bean.')); $method->setReturnType(ForeignKeys::class); $parameter = new ParameterGenerator('tableName'); diff --git a/src/Utils/DirectForeignKeyMethodDescriptor.php b/src/Utils/DirectForeignKeyMethodDescriptor.php index 97c88778..835c2b88 100644 --- a/src/Utils/DirectForeignKeyMethodDescriptor.php +++ b/src/Utils/DirectForeignKeyMethodDescriptor.php @@ -13,6 +13,7 @@ use TheCodingMachine\TDBM\Utils\Annotation; use Zend\Code\Generator\AbstractMemberGenerator; use Zend\Code\Generator\DocBlock\Tag\ReturnTag; +use Zend\Code\Generator\DocBlockGenerator; use Zend\Code\Generator\MethodGenerator; /** @@ -127,9 +128,11 @@ public function getCode() : array $getter = new MethodGenerator($this->getName()); if ($this->hasLocalUniqueIndex()) { - $getter->setDocBlock(sprintf('Returns the %s pointing to this bean via the %s column.', $beanClass, implode(', ', $this->foreignKey->getUnquotedLocalColumns()))); $classType = '\\' . $this->beanNamespace . '\\' . $beanClass; - $getter->getDocBlock()->setTag(new ReturnTag([$classType . '|null']))->setWordWrap(false); + $getterDocBlock = new DocBlockGenerator(sprintf('Returns the %s pointing to this bean via the %s column.', $beanClass, implode(', ', $this->foreignKey->getUnquotedLocalColumns()))); + $getterDocBlock->setTag([new ReturnTag([$classType . '|null'])]); + $getterDocBlock->setWordWrap(false); + $getter->setDocBlock($getterDocBlock); $getter->setReturnType('?' . $classType); $code = sprintf( @@ -139,11 +142,10 @@ public function getCode() : array $this->getFilters($this->foreignKey) ); } else { - $getter->setDocBlock(sprintf('Returns the list of %s pointing to this bean via the %s column.', $beanClass, implode(', ', $this->foreignKey->getUnquotedLocalColumns()))); - $getter->getDocBlock()->setTag(new ReturnTag([ - $beanClass . '[]', - '\\' . AlterableResultIterator::class - ]))->setWordWrap(false); + $getterDocBlock = new DocBlockGenerator(sprintf('Returns the list of %s pointing to this bean via the %s column.', $beanClass, implode(', ', $this->foreignKey->getUnquotedLocalColumns()))); + $getterDocBlock->setTag(new ReturnTag([$beanClass . '[]', '\\' . AlterableResultIterator::class])); + $getterDocBlock->setWordWrap(false); + $getter->setDocBlock($getterDocBlock); $getter->setReturnType(AlterableResultIterator::class); $code = sprintf( diff --git a/src/Utils/ObjectBeanPropertyDescriptor.php b/src/Utils/ObjectBeanPropertyDescriptor.php index d9605670..6d0087e4 100644 --- a/src/Utils/ObjectBeanPropertyDescriptor.php +++ b/src/Utils/ObjectBeanPropertyDescriptor.php @@ -10,6 +10,7 @@ use TheCodingMachine\TDBM\Utils\Annotation\AnnotationParser; use TheCodingMachine\TDBM\Utils\Annotation; use Zend\Code\Generator\AbstractMemberGenerator; +use Zend\Code\Generator\DocBlockGenerator; use Zend\Code\Generator\MethodGenerator; use Zend\Code\Generator\ParameterGenerator; @@ -159,7 +160,7 @@ public function getGetterSetterCode(): array $referencedBeanName = $this->namingStrategy->getBeanClassName($this->foreignKey->getForeignTableName()); $getter = new MethodGenerator($getterName); - $getter->setDocBlock('Returns the ' . $referencedBeanName . ' object bound to this object via the ' . implode(' and ', $this->foreignKey->getUnquotedLocalColumns()) . ' column.'); + $getter->setDocBlock(new DocBlockGenerator('Returns the ' . $referencedBeanName . ' object bound to this object via the ' . implode(' and ', $this->foreignKey->getUnquotedLocalColumns()) . ' column.')); /*$types = [ $referencedBeanName ]; if ($isNullable) { @@ -177,7 +178,7 @@ public function getGetterSetterCode(): array } $setter = new MethodGenerator($setterName); - $setter->setDocBlock('The setter for the ' . $referencedBeanName . ' object bound to this object via the ' . implode(' and ', $this->foreignKey->getUnquotedLocalColumns()) . ' column.'); + $setter->setDocBlock(new DocBlockGenerator('The setter for the ' . $referencedBeanName . ' object bound to this object via the ' . implode(' and ', $this->foreignKey->getUnquotedLocalColumns()) . ' column.')); $setter->setParameter(new ParameterGenerator('object', ($isNullable ? '?' : '') . $this->beanNamespace . '\\' . $referencedBeanName)); diff --git a/src/Utils/PivotTableMethodsDescriptor.php b/src/Utils/PivotTableMethodsDescriptor.php index 36dee569..c94e347f 100644 --- a/src/Utils/PivotTableMethodsDescriptor.php +++ b/src/Utils/PivotTableMethodsDescriptor.php @@ -7,6 +7,7 @@ use Doctrine\DBAL\Schema\Column; use Doctrine\DBAL\Schema\ForeignKeyConstraint; use Doctrine\DBAL\Schema\Table; +use Zend\Code\Generator\DocBlockGenerator; use function implode; use function sprintf; use TheCodingMachine\TDBM\Utils\Annotation\AnnotationParser; @@ -199,39 +200,49 @@ public function getCode() : array $localTableName = var_export($this->remoteFk->getLocalTableName(), true); $getter = new MethodGenerator($this->getName()); - $getter->setDocBlock(sprintf('Returns the list of %s associated to this bean via the %s pivot table.', $remoteBeanName, $this->pivotTable->getName())); - $getter->getDocBlock()->setTag(new ReturnTag([ $fqcnRemoteBeanName.'[]' ]))->setWordWrap(false); + $getterDocBlock = new DocBlockGenerator(sprintf('Returns the list of %s associated to this bean via the %s pivot table.', $remoteBeanName, $this->pivotTable->getName())); + $getterDocBlock->setTag(new ReturnTag([ $fqcnRemoteBeanName.'[]' ])); + $getterDocBlock->setWordWrap(false); + $getter->setDocBlock($getterDocBlock); $getter->setReturnType('array'); $getter->setBody(sprintf('return $this->_getRelationships(%s);', $pathKey)); $adder = new MethodGenerator('add'.$singularName); - $adder->setDocBlock(sprintf('Adds a relationship with %s associated to this bean via the %s pivot table.', $remoteBeanName, $this->pivotTable->getName())); - $adder->getDocBlock()->setTag(new ParamTag($variableName, [ $fqcnRemoteBeanName ]))->setWordWrap(false); + $adderDocBlock = new DocBlockGenerator(sprintf('Adds a relationship with %s associated to this bean via the %s pivot table.', $remoteBeanName, $this->pivotTable->getName())); + $adderDocBlock->setTag(new ParamTag($variableName, [ $fqcnRemoteBeanName ])); + $adderDocBlock->setWordWrap(false); + $adder->setDocBlock($adderDocBlock); $adder->setReturnType('void'); $adder->setParameter(new ParameterGenerator($variableName, $fqcnRemoteBeanName)); $adder->setBody(sprintf('$this->addRelationship(%s, $%s);', $localTableName, $variableName)); $remover = new MethodGenerator('remove'.$singularName); - $remover->setDocBlock(sprintf('Deletes the relationship with %s associated to this bean via the %s pivot table.', $remoteBeanName, $this->pivotTable->getName())); - $remover->getDocBlock()->setTag(new ParamTag($variableName, [ $fqcnRemoteBeanName ]))->setWordWrap(false); + $removerDocBlock = new DocBlockGenerator(sprintf('Deletes the relationship with %s associated to this bean via the %s pivot table.', $remoteBeanName, $this->pivotTable->getName())); + $removerDocBlock->setTag(new ParamTag($variableName, [ $fqcnRemoteBeanName ])); + $removerDocBlock->setWordWrap(false); + $remover->setDocBlock($removerDocBlock); $remover->setReturnType('void'); $remover->setParameter(new ParameterGenerator($variableName, $fqcnRemoteBeanName)); $remover->setBody(sprintf('$this->_removeRelationship(%s, $%s);', $localTableName, $variableName)); $has = new MethodGenerator('has'.$singularName); - $has->setDocBlock(sprintf('Returns whether this bean is associated with %s via the %s pivot table.', $remoteBeanName, $this->pivotTable->getName())); - $has->getDocBlock()->setTag(new ParamTag($variableName, [ $fqcnRemoteBeanName ]))->setWordWrap(false); - $has->getDocBlock()->setTag(new ReturnTag([ 'bool' ])); + $hasDocBlock = new DocBlockGenerator(sprintf('Returns whether this bean is associated with %s via the %s pivot table.', $remoteBeanName, $this->pivotTable->getName())); + $hasDocBlock->setTag(new ParamTag($variableName, [ $fqcnRemoteBeanName ])); + $hasDocBlock->setTag(new ReturnTag([ 'bool' ])); + $hasDocBlock->setWordWrap(false); + $has->setDocBlock($hasDocBlock); $has->setReturnType('bool'); $has->setParameter(new ParameterGenerator($variableName, $fqcnRemoteBeanName)); $has->setBody(sprintf('return $this->hasRelationship(%s, $%s);', $pathKey, $variableName)); $setter = new MethodGenerator('set'.$pluralName); - $setter->setDocBlock(sprintf('Sets all relationships with %s associated to this bean via the %s pivot table. + $setterDocBlock = new DocBlockGenerator(sprintf('Sets all relationships with %s associated to this bean via the %s pivot table. Exiting relationships will be removed and replaced by the provided relationships.', $remoteBeanName, $this->pivotTable->getName())); - $setter->getDocBlock()->setTag(new ParamTag($pluralVariableName, [ $fqcnRemoteBeanName.'[]' ]))->setWordWrap(false)->setWordWrap(false); - $setter->getDocBlock()->setTag(new ReturnTag([ 'void' ])); + $setterDocBlock->setTag(new ParamTag($pluralVariableName, [ $fqcnRemoteBeanName.'[]' ])); + $setterDocBlock->setTag(new ReturnTag([ 'void' ])); + $setterDocBlock->setWordWrap(false); + $setter->setDocBlock($setterDocBlock); $setter->setReturnType('void'); $setter->setParameter(new ParameterGenerator($pluralVariableName, 'array')); $setter->setBody(sprintf('$this->setRelationships(%s, $%s);', $pathKey, $pluralVariableName)); diff --git a/src/Utils/ScalarBeanPropertyDescriptor.php b/src/Utils/ScalarBeanPropertyDescriptor.php index 93ebd27e..0d6faf6a 100644 --- a/src/Utils/ScalarBeanPropertyDescriptor.php +++ b/src/Utils/ScalarBeanPropertyDescriptor.php @@ -14,6 +14,7 @@ use Zend\Code\Generator\AbstractMemberGenerator; use Zend\Code\Generator\DocBlock\Tag\ParamTag; use Zend\Code\Generator\DocBlock\Tag\ReturnTag; +use Zend\Code\Generator\DocBlockGenerator; use Zend\Code\Generator\MethodGenerator; use Zend\Code\Generator\ParameterGenerator; @@ -222,6 +223,10 @@ public function getGetterSetterCode(): array $resourceTypeCheck = sprintf($resourceTypeCheck, $checkNullable, $this->column->getName(), $this->column->getName()); } + $types = [ $normalizedType ]; + if ($isNullable) { + $types[] = 'null'; + } $paramType = null; if ($this->isTypeHintable()) { @@ -229,14 +234,9 @@ public function getGetterSetterCode(): array } $getter = new MethodGenerator($columnGetterName); - $getter->setDocBlock(sprintf('The getter for the "%s" column.', $this->column->getName())); - - $types = [ $normalizedType ]; - if ($isNullable) { - $types[] = 'null'; - } - $getter->getDocBlock()->setTag(new ReturnTag($types))->setWordWrap(false); - + $getterDocBlock = new DocBlockGenerator(sprintf('The getter for the "%s" column.', $this->column->getName())); + $getterDocBlock->setTag(new ReturnTag($types))->setWordWrap(false); + $getter->setDocBlock($getterDocBlock); $getter->setReturnType($paramType); $getter->setBody(sprintf( @@ -250,13 +250,9 @@ public function getGetterSetterCode(): array } $setter = new MethodGenerator($columnSetterName); - $setter->setDocBlock(sprintf('The setter for the "%s" column.', $this->column->getName())); - - $types = [ $normalizedType ]; - if ($isNullable) { - $types[] = 'null'; - } - $setter->getDocBlock()->setTag(new ParamTag($this->column->getName(), $types))->setWordWrap(false); + $setterDocBlock = new DocBlockGenerator(sprintf('The setter for the "%s" column.', $this->column->getName())); + $setterDocBlock->setTag(new ParamTag($this->column->getName(), $types))->setWordWrap(false); + $setter->setDocBlock($setterDocBlock); $parameter = new ParameterGenerator($this->column->getName(), $paramType); $setter->setParameter($parameter); diff --git a/tests/QueryFactory/FindObjectsFromRawSqlQueryFactoryTest.php b/tests/QueryFactory/FindObjectsFromRawSqlQueryFactoryTest.php index 6effb922..34c24c38 100644 --- a/tests/QueryFactory/FindObjectsFromRawSqlQueryFactoryTest.php +++ b/tests/QueryFactory/FindObjectsFromRawSqlQueryFactoryTest.php @@ -2,7 +2,7 @@ namespace TheCodingMachine\TDBM\QueryFactory; -use Doctrine\DBAL\Schema\Schema; +use Doctrine\Common\Cache\VoidCache; use TheCodingMachine\TDBM\TDBMAbstractServiceTest; use TheCodingMachine\TDBM\TDBMException; @@ -10,14 +10,14 @@ class FindObjectsFromRawSqlQueryFactoryTest extends TDBMAbstractServiceTest { public function testGetSubQueryColumnDescriptors(): void { - $queryFactory = new FindObjectsFromRawSqlQueryFactory($this->tdbmService, $this->tdbmService->getConnection()->getSchemaManager()->createSchema(), 'country', 'SELECT country.* FROM country'); + $queryFactory = new FindObjectsFromRawSqlQueryFactory($this->tdbmService, $this->tdbmService->getConnection()->getSchemaManager()->createSchema(), 'country', 'SELECT country.* FROM country', null, new VoidCache()); $this->expectException(TDBMException::class); $queryFactory->getSubQueryColumnDescriptors(); } public function testGetMagicSqlSubQuery(): void { - $queryFactory = new FindObjectsFromRawSqlQueryFactory($this->tdbmService, $this->tdbmService->getConnection()->getSchemaManager()->createSchema(), 'country', 'SELECT country.* FROM country'); + $queryFactory = new FindObjectsFromRawSqlQueryFactory($this->tdbmService, $this->tdbmService->getConnection()->getSchemaManager()->createSchema(), 'country', 'SELECT country.* FROM country', null, new VoidCache()); $this->expectException(TDBMException::class); $queryFactory->getMagicSqlSubQuery(); } diff --git a/vendor-bin/couscous/composer.lock b/vendor-bin/couscous/composer.lock index 0360772b..83bb5bb7 100644 --- a/vendor-bin/couscous/composer.lock +++ b/vendor-bin/couscous/composer.lock @@ -95,16 +95,16 @@ }, { "name": "couscous/couscous", - "version": "1.7.2", + "version": "1.7.3", "source": { "type": "git", "url": "https://github.com/CouscousPHP/Couscous.git", - "reference": "8944ea7b566ce02d11a91228f3d59f0b701df8d1" + "reference": "2925c93e25d7c650bc827cc53e5fdcb7d2ee0f30" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/CouscousPHP/Couscous/zipball/8944ea7b566ce02d11a91228f3d59f0b701df8d1", - "reference": "8944ea7b566ce02d11a91228f3d59f0b701df8d1", + "url": "https://api.github.com/repos/CouscousPHP/Couscous/zipball/2925c93e25d7c650bc827cc53e5fdcb7d2ee0f30", + "reference": "2925c93e25d7c650bc827cc53e5fdcb7d2ee0f30", "shasum": "" }, "require": { @@ -140,7 +140,7 @@ "license": [ "MIT" ], - "time": "2019-07-12T09:20:06+00:00" + "time": "2019-10-19T16:39:59+00:00" }, { "name": "erusev/parsedown", @@ -707,16 +707,16 @@ }, { "name": "php-di/phpdoc-reader", - "version": "2.1.0", + "version": "2.1.1", "source": { "type": "git", "url": "https://github.com/PHP-DI/PhpDocReader.git", - "reference": "7d0de60b9341933c8afd172a6255cd7557601e0e" + "reference": "15678f7451c020226807f520efb867ad26fbbfcf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-DI/PhpDocReader/zipball/7d0de60b9341933c8afd172a6255cd7557601e0e", - "reference": "7d0de60b9341933c8afd172a6255cd7557601e0e", + "url": "https://api.github.com/repos/PHP-DI/PhpDocReader/zipball/15678f7451c020226807f520efb867ad26fbbfcf", + "reference": "15678f7451c020226807f520efb867ad26fbbfcf", "shasum": "" }, "require": { @@ -740,7 +740,7 @@ "phpdoc", "reflection" ], - "time": "2018-02-18T17:39:01+00:00" + "time": "2019-09-26T11:24:58+00:00" }, { "name": "psr/container", @@ -793,16 +793,16 @@ }, { "name": "psr/log", - "version": "1.1.0", + "version": "1.1.2", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd" + "reference": "446d54b4cb6bf489fc9d75f55843658e6f25d801" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", - "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "url": "https://api.github.com/repos/php-fig/log/zipball/446d54b4cb6bf489fc9d75f55843658e6f25d801", + "reference": "446d54b4cb6bf489fc9d75f55843658e6f25d801", "shasum": "" }, "require": { @@ -811,7 +811,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.1.x-dev" } }, "autoload": { @@ -836,20 +836,20 @@ "psr", "psr-3" ], - "time": "2018-11-20T15:27:04+00:00" + "time": "2019-11-01T11:05:21+00:00" }, { "name": "symfony/console", - "version": "v4.3.4", + "version": "v4.3.8", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "de63799239b3881b8a08f8481b22348f77ed7b36" + "reference": "831424efae0a1fe6642784bd52aae14ece6538e6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/de63799239b3881b8a08f8481b22348f77ed7b36", - "reference": "de63799239b3881b8a08f8481b22348f77ed7b36", + "url": "https://api.github.com/repos/symfony/console/zipball/831424efae0a1fe6642784bd52aae14ece6538e6", + "reference": "831424efae0a1fe6642784bd52aae14ece6538e6", "shasum": "" }, "require": { @@ -911,11 +911,11 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2019-08-26T08:26:39+00:00" + "time": "2019-11-13T07:29:07+00:00" }, { "name": "symfony/filesystem", - "version": "v4.3.4", + "version": "v4.3.8", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", @@ -965,16 +965,16 @@ }, { "name": "symfony/finder", - "version": "v4.3.4", + "version": "v4.3.8", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "86c1c929f0a4b24812e1eb109262fc3372c8e9f2" + "reference": "72a068f77e317ae77c0a0495236ad292cfb5ce6f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/86c1c929f0a4b24812e1eb109262fc3372c8e9f2", - "reference": "86c1c929f0a4b24812e1eb109262fc3372c8e9f2", + "url": "https://api.github.com/repos/symfony/finder/zipball/72a068f77e317ae77c0a0495236ad292cfb5ce6f", + "reference": "72a068f77e317ae77c0a0495236ad292cfb5ce6f", "shasum": "" }, "require": { @@ -1010,7 +1010,7 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2019-08-14T12:26:46+00:00" + "time": "2019-10-30T12:53:54+00:00" }, { "name": "symfony/polyfill-ctype", @@ -1189,16 +1189,16 @@ }, { "name": "symfony/process", - "version": "v4.3.4", + "version": "v4.3.8", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "e89969c00d762349f078db1128506f7f3dcc0d4a" + "reference": "3b2e0cb029afbb0395034509291f21191d1a4db0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/e89969c00d762349f078db1128506f7f3dcc0d4a", - "reference": "e89969c00d762349f078db1128506f7f3dcc0d4a", + "url": "https://api.github.com/repos/symfony/process/zipball/3b2e0cb029afbb0395034509291f21191d1a4db0", + "reference": "3b2e0cb029afbb0395034509291f21191d1a4db0", "shasum": "" }, "require": { @@ -1234,20 +1234,20 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2019-08-26T08:26:39+00:00" + "time": "2019-10-28T17:07:32+00:00" }, { "name": "symfony/service-contracts", - "version": "v1.1.6", + "version": "v1.1.8", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "ea7263d6b6d5f798b56a45a5b8d686725f2719a3" + "reference": "ffc7f5692092df31515df2a5ecf3b7302b3ddacf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/ea7263d6b6d5f798b56a45a5b8d686725f2719a3", - "reference": "ea7263d6b6d5f798b56a45a5b8d686725f2719a3", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/ffc7f5692092df31515df2a5ecf3b7302b3ddacf", + "reference": "ffc7f5692092df31515df2a5ecf3b7302b3ddacf", "shasum": "" }, "require": { @@ -1292,20 +1292,20 @@ "interoperability", "standards" ], - "time": "2019-08-20T14:44:19+00:00" + "time": "2019-10-14T12:27:06+00:00" }, { "name": "symfony/yaml", - "version": "v4.3.4", + "version": "v4.3.8", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "5a0b7c32dc3ec56fd4abae8a4a71b0cf05013686" + "reference": "324cf4b19c345465fad14f3602050519e09e361d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/5a0b7c32dc3ec56fd4abae8a4a71b0cf05013686", - "reference": "5a0b7c32dc3ec56fd4abae8a4a71b0cf05013686", + "url": "https://api.github.com/repos/symfony/yaml/zipball/324cf4b19c345465fad14f3602050519e09e361d", + "reference": "324cf4b19c345465fad14f3602050519e09e361d", "shasum": "" }, "require": { @@ -1351,20 +1351,20 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2019-08-20T14:27:59+00:00" + "time": "2019-10-30T12:58:49+00:00" }, { "name": "twig/twig", - "version": "v1.42.3", + "version": "v1.42.4", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "201baee843e0ffe8b0b956f336dd42b2a92fae4e" + "reference": "e587180584c3d2d6cb864a0454e777bb6dcb6152" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/201baee843e0ffe8b0b956f336dd42b2a92fae4e", - "reference": "201baee843e0ffe8b0b956f336dd42b2a92fae4e", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/e587180584c3d2d6cb864a0454e777bb6dcb6152", + "reference": "e587180584c3d2d6cb864a0454e777bb6dcb6152", "shasum": "" }, "require": { @@ -1397,19 +1397,19 @@ "authors": [ { "name": "Fabien Potencier", - "role": "Lead Developer", "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org" + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" }, { "name": "Twig Team", - "role": "Contributors", - "homepage": "https://twig.symfony.com/contributors" + "homepage": "https://twig.symfony.com/contributors", + "role": "Contributors" }, { "name": "Armin Ronacher", - "role": "Project Founder", - "email": "armin.ronacher@active-4.com" + "email": "armin.ronacher@active-4.com", + "role": "Project Founder" } ], "description": "Twig, the flexible, fast, and secure template language for PHP", @@ -1417,7 +1417,7 @@ "keywords": [ "templating" ], - "time": "2019-08-24T12:51:03+00:00" + "time": "2019-11-11T16:49:32+00:00" } ], "packages-dev": [], diff --git a/vendor-bin/require-checker/composer.lock b/vendor-bin/require-checker/composer.lock index 6c851013..afda567f 100644 --- a/vendor-bin/require-checker/composer.lock +++ b/vendor-bin/require-checker/composer.lock @@ -176,16 +176,16 @@ }, { "name": "symfony/console", - "version": "v4.3.4", + "version": "v4.3.8", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "de63799239b3881b8a08f8481b22348f77ed7b36" + "reference": "831424efae0a1fe6642784bd52aae14ece6538e6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/de63799239b3881b8a08f8481b22348f77ed7b36", - "reference": "de63799239b3881b8a08f8481b22348f77ed7b36", + "url": "https://api.github.com/repos/symfony/console/zipball/831424efae0a1fe6642784bd52aae14ece6538e6", + "reference": "831424efae0a1fe6642784bd52aae14ece6538e6", "shasum": "" }, "require": { @@ -247,7 +247,7 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2019-08-26T08:26:39+00:00" + "time": "2019-11-13T07:29:07+00:00" }, { "name": "symfony/polyfill-mbstring", @@ -368,16 +368,16 @@ }, { "name": "symfony/service-contracts", - "version": "v1.1.6", + "version": "v1.1.8", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "ea7263d6b6d5f798b56a45a5b8d686725f2719a3" + "reference": "ffc7f5692092df31515df2a5ecf3b7302b3ddacf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/ea7263d6b6d5f798b56a45a5b8d686725f2719a3", - "reference": "ea7263d6b6d5f798b56a45a5b8d686725f2719a3", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/ffc7f5692092df31515df2a5ecf3b7302b3ddacf", + "reference": "ffc7f5692092df31515df2a5ecf3b7302b3ddacf", "shasum": "" }, "require": { @@ -422,7 +422,7 @@ "interoperability", "standards" ], - "time": "2019-08-20T14:44:19+00:00" + "time": "2019-10-14T12:27:06+00:00" } ], "packages-dev": [],