Skip to content

Commit

Permalink
Merge pull request #13469 from cakephp/4.x-cleanup
Browse files Browse the repository at this point in the history
4.x cleanup
  • Loading branch information
markstory committed Aug 6, 2019
2 parents 89136cb + 48e9213 commit 99b4b88
Show file tree
Hide file tree
Showing 43 changed files with 98 additions and 129 deletions.
21 changes: 1 addition & 20 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -840,9 +840,6 @@
</PossiblyNullOperand>
</file>
<file src="src/Http/Response.php">
<InvalidScalarArgument occurrences="1">
<code>$time</code>
</InvalidScalarArgument>
<PossiblyInvalidArgument occurrences="5">
<code>env('HTTP_ACCEPT_ENCODING')</code>
<code>env('HTTP_ACCEPT_ENCODING')</code>
Expand Down Expand Up @@ -1275,21 +1272,6 @@
<code>Email::MESSAGE_TEXT</code>
</DeprecatedConstant>
</file>
<file src="src/TestSuite/Constraint/Email/MailSentFrom.php">
<MissingPropertyType occurrences="1">
<code>$method</code>
</MissingPropertyType>
</file>
<file src="src/TestSuite/Constraint/Email/MailSentTo.php">
<MissingPropertyType occurrences="1">
<code>$method</code>
</MissingPropertyType>
</file>
<file src="src/TestSuite/Constraint/Email/MailSentWith.php">
<MissingPropertyType occurrences="1">
<code>$method</code>
</MissingPropertyType>
</file>
<file src="src/TestSuite/Constraint/EventFired.php">
<InternalClass occurrences="1"/>
<PossiblyNullReference occurrences="1">
Expand Down Expand Up @@ -1417,8 +1399,7 @@
</PossiblyNullArgument>
</file>
<file src="src/Utility/Hash.php">
<PossiblyInvalidArgument occurrences="16">
<code>$data</code>
<PossiblyInvalidArgument occurrences="15">
<code>$keys</code>
<code>$keys</code>
<code>$vals</code>
Expand Down
2 changes: 1 addition & 1 deletion src/Cache/Engine/RedisEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ public function delete($key): bool
*/
public function clear(): bool
{
$this->_Redis->setOption(Redis::OPT_SCAN, Redis::SCAN_RETRY);
$this->_Redis->setOption(Redis::OPT_SCAN, (string)Redis::SCAN_RETRY);

$isAllDeleted = true;
$iterator = null;
Expand Down
3 changes: 3 additions & 0 deletions src/Console/Exception/MissingHelperException.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,8 @@
*/
class MissingHelperException extends Exception
{
/**
* @var string
*/
protected $_messageTemplate = 'Helper class %s could not be found.';
}
3 changes: 3 additions & 0 deletions src/Console/Exception/MissingShellException.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
*/
class MissingShellException extends Exception
{
/**
* @var string
*/
// phpcs:ignore Generic.Files.LineLength
protected $_messageTemplate = 'Shell class for "%s" could not be found. If you are trying to use a plugin shell, that was loaded via $this->addPlugin(), you may need to update bin/cake.php to match https://github.com/cakephp/app/tree/master/bin/cake.php';
}
3 changes: 3 additions & 0 deletions src/Console/Exception/MissingShellMethodException.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,8 @@
*/
class MissingShellMethodException extends Exception
{
/**
* @var string
*/
protected $_messageTemplate = "Unknown command %1\$s %2\$s.\nFor usage try `cake %1\$s --help`";
}
3 changes: 3 additions & 0 deletions src/Console/Exception/MissingTaskException.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,8 @@
*/
class MissingTaskException extends Exception
{
/**
* @var string
*/
protected $_messageTemplate = 'Task class %s could not be found.';
}
2 changes: 1 addition & 1 deletion src/Datasource/ConnectionManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class ConnectionManager
/**
* An array mapping url schemes to fully qualified driver class names
*
* @return array
* @var string[]
*/
protected static $_dsnClassMap = [
'mysql' => Mysql::class,
Expand Down
3 changes: 3 additions & 0 deletions src/Datasource/Exception/MissingDatasourceConfigException.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,8 @@
*/
class MissingDatasourceConfigException extends Exception
{
/**
* @var string
*/
protected $_messageTemplate = 'The datasource configuration "%s" was not found.';
}
3 changes: 3 additions & 0 deletions src/Datasource/Exception/MissingDatasourceException.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,8 @@
*/
class MissingDatasourceException extends Exception
{
/**
* @var string
*/
protected $_messageTemplate = 'Datasource class %s could not be found. %s';
}
3 changes: 3 additions & 0 deletions src/Datasource/Exception/MissingModelException.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,8 @@
*/
class MissingModelException extends Exception
{
/**
* @var string
*/
protected $_messageTemplate = 'Model class "%s" of type "%s" could not be found.';
}
2 changes: 2 additions & 0 deletions src/Filesystem/Folder.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ class Folder

/**
* Functions array to be called depending on the sort type chosen.
*
* @var string[]
*/
protected $_fsorts = [
self::SORT_NAME => 'getPathname',
Expand Down
3 changes: 3 additions & 0 deletions src/ORM/Exception/MissingBehaviorException.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,8 @@
*/
class MissingBehaviorException extends Exception
{
/**
* @var string
*/
protected $_messageTemplate = 'Behavior class %s could not be found.';
}
3 changes: 3 additions & 0 deletions src/ORM/Exception/MissingEntityException.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,8 @@
*/
class MissingEntityException extends Exception
{
/**
* @var string
*/
protected $_messageTemplate = 'Entity class %s could not be found.';
}
3 changes: 3 additions & 0 deletions src/ORM/Exception/MissingTableClassException.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,8 @@
*/
class MissingTableClassException extends Exception
{
/**
* @var string
*/
protected $_messageTemplate = 'Table class %s could not be found.';
}
3 changes: 3 additions & 0 deletions src/ORM/Exception/RolledbackTransactionException.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
*/
class RolledbackTransactionException extends Exception
{
/**
* @var string
*/
// phpcs:ignore Generic.Files.LineLength
protected $_messageTemplate = 'The afterSave event in "%s" is aborting the transaction before the save process is done.';
}
3 changes: 3 additions & 0 deletions src/TestSuite/Constraint/Email/MailConstraintBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
*/
abstract class MailConstraintBase extends Constraint
{
/**
* @var int|null
*/
protected $at;

/**
Expand Down
3 changes: 3 additions & 0 deletions src/TestSuite/Constraint/Email/MailContainsHtml.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
*/
class MailContainsHtml extends MailContains
{
/**
* @var string
*/
protected $type = Email::MESSAGE_HTML;

/**
Expand Down
3 changes: 3 additions & 0 deletions src/TestSuite/Constraint/Email/MailContainsText.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
*/
class MailContainsText extends MailContains
{
/**
* @var string
*/
protected $type = Email::MESSAGE_TEXT;

/**
Expand Down
3 changes: 3 additions & 0 deletions src/TestSuite/Constraint/Email/MailSentFrom.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
*/
class MailSentFrom extends MailSentWith
{
/**
* @var string
*/
protected $method = 'from';

/**
Expand Down
3 changes: 3 additions & 0 deletions src/TestSuite/Constraint/Email/MailSentTo.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
*/
class MailSentTo extends MailSentWith
{
/**
* @var string
*/
protected $method = 'to';

/**
Expand Down
6 changes: 5 additions & 1 deletion src/TestSuite/Constraint/Email/MailSentWith.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
*/
class MailSentWith extends MailConstraintBase
{
/**
* @var string
*/
protected $method;

/**
Expand All @@ -34,9 +37,10 @@ class MailSentWith extends MailConstraintBase
*/
public function __construct(?int $at = null, ?string $method = null)
{
if ($method) {
if ($method !== null) {
$this->method = $method;
}

parent::__construct($at);
}

Expand Down
3 changes: 3 additions & 0 deletions src/TestSuite/Constraint/Response/StatusError.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
*/
class StatusError extends StatusCodeBase
{
/**
* @var int[]
*/
protected $code = [400, 429];

/**
Expand Down
3 changes: 3 additions & 0 deletions src/TestSuite/Constraint/Response/StatusFailure.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
*/
class StatusFailure extends StatusCodeBase
{
/**
* @var int[]
*/
protected $code = [500, 505];

/**
Expand Down
3 changes: 3 additions & 0 deletions src/TestSuite/Constraint/Response/StatusOk.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
*/
class StatusOk extends StatusCodeBase
{
/**
* @var int[]
*/
protected $code = [200, 204];

/**
Expand Down
3 changes: 3 additions & 0 deletions src/TestSuite/Constraint/Response/StatusSuccess.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
*/
class StatusSuccess extends StatusCodeBase
{
/**
* @var int[]
*/
protected $code = [200, 308];

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/Command/PluginUnloadCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* @link https://cakephp.org CakePHP Project
* @license https://opensource.org/licenses/mit-license.php MIT License
*/
namespace Cake\Test\TestCase\Shell\Task;
namespace Cake\Test\TestCase\Command;

use Cake\Console\Command;
use Cake\TestSuite\ConsoleIntegrationTestTrait;
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/Console/ArgumentsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* @since 3.6.0
* @license https://opensource.org/licenses/mit-license.php MIT License
*/
namespace Cake\Test\TestSuite\Console;
namespace Cake\Test\TestCase\Console;

use Cake\Console\Arguments;
use Cake\TestSuite\TestCase;
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/Console/CommandCollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* @since 3.5.0
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
namespace Cake\Test\Console;
namespace Cake\Test\TestCase\Console;

use Cake\Command\RoutesCommand;
use Cake\Command\VersionCommand;
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/Console/CommandRunnerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* @since 3.5.0
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
namespace Cake\Test\Console;
namespace Cake\Test\TestCase\Console;

use Cake\Console\CommandCollection;
use Cake\Console\CommandFactoryInterface;
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/Event/Decorator/ConditionDecoratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* @since 3.3.0
* @license https://opensource.org/licenses/mit-license.php MIT License
*/
namespace Cake\Test\TestCase\Event;
namespace Cake\Test\TestCase\Event\Decorator;

use Cake\Event\Decorator\ConditionDecorator;
use Cake\Event\Event;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* @since 3.3.0
* @license https://opensource.org/licenses/mit-license.php MIT License
*/
namespace Cake\Test\TestCase\Event;
namespace Cake\Test\TestCase\Event\Decorator;

use Cake\Event\Decorator\SubjectFilterDecorator;
use Cake\Event\Event;
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/Http/ResponseEmitterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* @since 3.3.5
* @license https://opensource.org/licenses/mit-license.php MIT License
*/
namespace Cake\Test\TestCase;
namespace Cake\Test\TestCase\Http;

use Cake\Http\CallbackStream;
use Cake\Http\Cookie\Cookie;
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/Http/RunnerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* @since 3.3.0
* @license https://opensource.org/licenses/mit-license.php MIT License
*/
namespace Cake\Test\TestCase;
namespace Cake\Test\TestCase\Http;

use Cake\Http\MiddlewareQueue;
use Cake\Http\Response;
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/Http/ServerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* @since 3.3.0
* @license https://opensource.org/licenses/mit-license.php MIT License
*/
namespace Cake\Test\TestCase;
namespace Cake\Test\TestCase\Http;

use Cake\Core\HttpApplicationInterface;
use Cake\Event\EventInterface;
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/Http/SessionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* @since 1.2.0
* @license https://opensource.org/licenses/mit-license.php MIT License
*/
namespace Cake\Test\TestCase\Network;
namespace Cake\Test\TestCase\Http;

use Cake\Http\Session;
use Cake\TestSuite\TestCase;
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/I18n/Formatter/IcuFormatterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* @since 3.0.0
* @license https://opensource.org/licenses/mit-license.php MIT License
*/
namespace Cake\Test\TestCase\I18n;
namespace Cake\Test\TestCase\I18n\Formatter;

use Cake\I18n\Formatter\IcuFormatter;
use Cake\TestSuite\TestCase;
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/I18n/Formatter/SprintfFormatterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* @since 3.0.0
* @license https://opensource.org/licenses/mit-license.php MIT License
*/
namespace Cake\Test\TestCase\I18n;
namespace Cake\Test\TestCase\I18n\Formatter;

use Cake\I18n\Formatter\SprintfFormatter;
use Cake\TestSuite\TestCase;
Expand Down
Loading

0 comments on commit 99b4b88

Please sign in to comment.