diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fc74660a4..5607aee81 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,46 +1,48 @@ name: Build on: - push: - branches: - - master - pull_request: - branches: - - master + push: + branches: + - master + pull_request: + branches: + - master jobs: - build: - name: PHP ${{ matrix.php-versions }} ${{ matrix.composer-args }} - strategy: - fail-fast: false - matrix: - operating-system: [ubuntu-latest] - php-versions: ['7.4', '8.0', '8.1', '8.2'] - composer-args: ['', '--prefer-lowest'] - runs-on: ${{ matrix.operating-system }} - steps: - - name: Checkout - uses: actions/checkout@v4.1.2 - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php-versions }} - extensions: mbstring, apcu - ini-values: apc.enable_cli=1 - coverage: xdebug - - name: Install Dependencies - run: | - composer update --no-progress --no-suggest --prefer-stable --optimize-autoloader ${{ matrix.composer-args }} - - name: Static Analysis - run: | - composer phpstan - composer psalm -- --shepherd - - name: Code Style Check - env: - PHP_CS_FIXER_IGNORE_ENV: true - run: composer style-check - - name: Test - run: composer test-with-coverage - - name: Upload Coverage - uses: codecov/codecov-action@v3 - with: - files: ./tests/coverage/clover.xml - verbose: true + build: + name: PHP ${{ matrix.php-versions }} ${{ matrix.composer-args }} + strategy: + fail-fast: false + matrix: + operating-system: [ubuntu-latest] + php-versions: ["7.4", "8.0", "8.1", "8.2"] + composer-args: ["", "--prefer-lowest"] + runs-on: ${{ matrix.operating-system }} + steps: + - name: Checkout + uses: actions/checkout@v4.1.2 + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + extensions: mbstring, apcu + ini-values: apc.enable_cli=1 + coverage: xdebug + - name: Install Dependencies + run: | + composer update --no-progress --no-suggest --prefer-stable --optimize-autoloader ${{ matrix.composer-args }} + - name: Static Analysis + run: | + composer phpstan + composer psalm -- --shepherd + - name: Code Style Check + env: + PHP_CS_FIXER_IGNORE_ENV: true + run: composer style-check + - name: Test + run: composer test-with-coverage + - name: Upload Coverage + uses: codecov/codecov-action@v4 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + with: + files: ./tests/coverage/clover.xml + verbose: true diff --git a/composer.json b/composer.json index 7e701e508..b5990a79a 100644 --- a/composer.json +++ b/composer.json @@ -39,13 +39,13 @@ "require": { "php": "^7.4 || ~8.0.0 || ~8.1.0 || ~8.2.0", "ext-pdo": "*", - "symfony/yaml": "^3.4 || ^4.1 || ^5.0" + "symfony/yaml": "^3.4 || ^4.1 || ^5.0 || ^6.0 || ^7.0" }, "require-dev": { "phpunit/php-code-coverage": "^9.1.10", "friendsofphp/php-cs-fixer": "^3.51.0", "phpstan/phpstan": "1.10.14", - "vimeo/psalm": "5.9.0" + "vimeo/psalm": "5.23.1" }, "scripts": { "test": "cd tests && php run.php", diff --git a/lib/Doctrine/Cache/Memcache.php b/lib/Doctrine/Cache/Memcache.php index fd1f6ad6b..c88b69900 100644 --- a/lib/Doctrine/Cache/Memcache.php +++ b/lib/Doctrine/Cache/Memcache.php @@ -145,7 +145,7 @@ protected function _getCacheKeys() foreach (array_keys($slabs) as $slabId) { $dump = $this->_memcache->getExtendedStats('cachedump', (int) $slabId); foreach ($dump as $entries) { - if ($entries) { + if ($entries !== false && !empty($entries)) { $keys = array_merge($keys, array_keys($entries)); } } diff --git a/lib/Doctrine/Import/Schema.php b/lib/Doctrine/Import/Schema.php index c23972d37..f92a6affe 100644 --- a/lib/Doctrine/Import/Schema.php +++ b/lib/Doctrine/Import/Schema.php @@ -277,7 +277,7 @@ public function importSchema($schema, $format = 'yml', $directory = null, $model if (count($array) == 0) { throw new Doctrine_Import_Exception( - sprintf('No ' . $format . ' schema found in ' . implode(', ', $schema)) + 'No ' . $format . ' schema found in ' . implode(', ', $schema) ); } @@ -766,7 +766,7 @@ protected function _validateSchemaElement($name, $element, $path) foreach ($element as $key => $value) { if (! isset($validation[$value])) { throw new Doctrine_Import_Exception( - sprintf('Invalid schema element named "' . $value . '" at path "' . $path . '"') + 'Invalid schema element named "' . $value . '" at path "' . $path . '"' ); } } diff --git a/psalm-baseline.xml b/psalm-baseline.xml index a9e818efb..c53b746ac 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -1,27 +1,48 @@ - + - ArrayAccess + + + + + + + - $var + + + + + + + + - - toArray()]]> - - new $class() - new $class() + + + + + + + + + + + + + - $slabId + _memcache]]> @@ -30,42 +51,65 @@ _memcache]]> _memcache]]> _memcache]]> - Memcache - protected $_memcache = null; + + + + + + + isSubclassOf(self::TASK_BASE_CLASS)]]> - return true; + + + + + + + + + + + + + + + + + + + - getRelations + - mixed + - IteratorAggregate + - Iterator + - Iterator + - IteratorAggregate + @@ -77,131 +121,222 @@ - getTableName - getTableName + + formatter->convertBooleans($item)]]> - array|int + - IteratorAggregate + - $parent - $parent - $parent - $parent - $parent - $parent - $parent - $parent - $parent + + + + + + + + + pendingAttributes[$attribute]]]> + + + + + isConnected]]> + isConnected]]> + + - $fields[$i] + + + + + + + + + + + - IteratorAggregate + - $dbh + + + isConnected]]> + - $arg1 + + + + + - return $id; + + + + + getOption('joinedParents')]]> + getOption('joinedParents')]]> + getOption('joinedParents')]]> + - new $parent() + - bool|int + migrate($to)]]> - array_values - array_values + + + + + + + + + + + + + + + + isRelation($record, $key)]]> + - new $className() + + + + + + + + + + + + + + + + - (int)$length - (int)$length - (int)$length - (int)$length - (int)$length + + + + + + + + + + + + + + + + + + + + + + - new $name() + - $conn + - $conn + - IteratorAggregate + - $key + - $key + - null + + + + + - new $name + + + + + + - return; + + + + @@ -216,76 +351,139 @@ _queryComponents[$alias]['map']) ? $this->_queryComponents[$alias]['map'] : null]]> + + _tables[$component]->getOption('subclasses'))]]> + + + - return; + + + + + + + - array|scalar + - $result[0] + - false + - null - null + + - $name - $name - $name - $name + + + + + + getAttribute(Doctrine_Core::ATTR_MODEL_CLASS_PREFIX)]]> + getAttribute(Doctrine_Core::ATTR_AUTO_ACCESSOR_OVERRIDE)]]> + + getAttribute(Doctrine_Core::ATTR_TABLE_CLASS)]]> + getAttribute(Doctrine_Core::ATTR_TABLE_CLASS_FORMAT)]]> + + + + + + + + + + + + - $conn + + + + + + + + + + - $args[0] + - IteratorAggregate + + + + + + + + + - IteratorAggregate + - - count($parts) == 0 - + + + + + + + + - $num - end($nums) + + _migrationClasses]]> - void + + + + + - new $className() + + + + + + + + + @@ -293,113 +491,180 @@ - IteratorAggregate + + + getOption('subclasses')]]> + getOption('inheritanceMap')]]> + - new $class($record, $options) + - Iterator + - Iterator + - Iterator + - Iterator + - Iterator + - Iterator + - $_tree + + + _tree->getAttribute('hasManyRoots')]]> + + _tree->getAttribute('hasManyRoots')]]> + _tree->getAttribute('hasManyRoots')]]> + - Iterator + + + + + + + + + + + + + + + + + _sqlParts['limit']]]> _sqlParts['limit']]]> _sqlParts['where']]]> _sqlParts['where']]]> + + + + + + + + + + + + + _sqlParts['limit'])]]> + _sqlParts['orderby'])]]> + _sqlParts['where'])]]> + + + + + + + _params = & $query->_params]]> + _queryComponents = & $query->_queryComponents]]> + _tableAliasMap = & $query->_tableAliasMap]]> + - $parts[0] - $parts[0] + + - $value + - $e[2] + + + + + + + + + + + - $index - $key + + - $key + + + + + + + - - $array - toArray($deep, true)]]> - - setInvoker + _data]]> _id]]> - - toArray($deep)]]> - - - false|int|string|array - - IteratorAggregate + + + _table->getAttribute(Doctrine_Core::ATTR_VALIDATE)]]> + + + + + + _table->getAttribute(Doctrine_Core::ATTR_AUTO_ACCESSOR_OVERRIDE)]]> + _table->getAttribute(Doctrine_Core::ATTR_AUTO_ACCESSOR_OVERRIDE)]]> + @@ -408,36 +673,65 @@ - Doctrine_Record_Iterator + - getConnection + - ArrayAccess + + + + + getOrderByStatement($alias, $columnNames)]]> + + + + + + + + + + + + + + + + + + + + getOrderByStatement($tableName, true)]]> + + - addIndex - getFieldName - isIdentifier + + + - $columns[0] + + + + - getColumnName - getColumnName + + - new $class() - new $class() - new $class() + + + @@ -447,150 +741,174 @@ - $result + + + + - $conn + - mixed + + + + + + + + + _columns[$columnName]) ? $this->_columns[$columnName]['type'] : false]]> - \AllowDynamicProperties + - $arguments[0] - $arguments[0] + + + + + + getAttribute(Doctrine_Core::ATTR_DEFAULT_TABLE_CHARSET)]]> + getAttribute(Doctrine_Core::ATTR_DEFAULT_TABLE_COLLATE)]]> + + + - new $class - new $name($this) + + - IteratorAggregate + - $description + - $description + - $description + - $description + - $description + - $description + - $description + - $description + - $description + - $description + - $description + - $description + - $description + - $description + - $description + - $description + - $description + - $description + - $description + - $description + - $description + - $_plugin + + + + getTable()->getOption('inheritanceMap')]]> + + getTimestamp('updated', $event->getInvoker()->getTable()->getConnection())]]> @@ -598,32 +916,45 @@ - $_plugin + - $_plugin + + + getOption('inheritanceMap')]]> + - new $class($table, $options) + - - - $value - + + + getAttribute('levelColumnName')]]> + + getAttribute('rootColumnName')]]> + getAttribute('rootColumnName')]]> + getAttribute('hasManyRoots')]]> + getAttribute('rootColumnName')]]> + - IteratorAggregate + - IteratorAggregate + + + + args]]> + +