Skip to content

Commit

Permalink
Code Cleanup
Browse files Browse the repository at this point in the history
Remove unused use statements from CakePHP core
  • Loading branch information
pirouet committed Mar 30, 2015
1 parent 8514c62 commit 0b41e2c
Show file tree
Hide file tree
Showing 34 changed files with 39 additions and 39 deletions.
1 change: 0 additions & 1 deletion src/Cache/Engine/FileEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
namespace Cake\Cache\Engine;

use Cake\Cache\CacheEngine;
use Cake\Core\Configure;
use Cake\Utility\Inflector;
use Exception;
use LogicException;
Expand Down
1 change: 0 additions & 1 deletion src/Collection/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
use Cake\Collection\CollectionTrait;
use InvalidArgumentException;
use IteratorIterator;
use JsonSerializable;

/**
* A collection is an immutable list of elements with a handful of functions to
Expand Down
4 changes: 1 addition & 3 deletions src/Controller/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@
use Cake\Log\LogTrait;
use Cake\Network\Request;
use Cake\Network\Response;
use Cake\ORM\TableRegistry;
use Cake\Routing\RequestActionTrait;
use Cake\Routing\Router;
use Cake\Utility\Inflector;
use Cake\Utility\MergeVariablesTrait;
use Cake\View\ViewVarsTrait;
use LogicException;
Expand Down Expand Up @@ -649,7 +647,7 @@ public function isAction($action)
{
try {
$method = new ReflectionMethod($this, $action);
} catch (\ReflectionException $e) {
} catch (ReflectionException $e) {
return false;
}
if (!$method->isPublic()) {
Expand Down
2 changes: 0 additions & 2 deletions src/Core/Configure/Engine/IniConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@

use Cake\Core\Configure\ConfigEngineInterface;
use Cake\Core\Configure\FileConfigTrait;
use Cake\Core\Exception\Exception;
use Cake\Core\Plugin;
use Cake\Utility\Hash;

/**
Expand Down
1 change: 0 additions & 1 deletion src/Core/Configure/Engine/JsonConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
use Cake\Core\Configure\ConfigEngineInterface;
use Cake\Core\Configure\FileConfigTrait;
use Cake\Core\Exception\Exception;
use Cake\Core\Plugin;

/**
* JSON engine allows Configure to load configuration values from
Expand Down
1 change: 0 additions & 1 deletion src/Core/Configure/Engine/PhpConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
use Cake\Core\Configure\ConfigEngineInterface;
use Cake\Core\Configure\FileConfigTrait;
use Cake\Core\Exception\Exception;
use Cake\Core\Plugin;

/**
* PHP engine allows Configure to load configuration values from
Expand Down
4 changes: 3 additions & 1 deletion src/Core/Exception/Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@
*/
namespace Cake\Core\Exception;

use RuntimeException;

/**
* Base class that all CakePHP Exceptions extend.
*
*/
class Exception extends \RuntimeException
class Exception extends RuntimeException
{

/**
Expand Down
1 change: 0 additions & 1 deletion src/Core/InstanceConfigTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

use Cake\Core\Exception\Exception;
use Cake\Utility\Hash;
use InvalidArgumentException;

/**
* A trait for reading and writing instance config
Expand Down
1 change: 0 additions & 1 deletion src/Core/StaticConfigTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

use BadMethodCallException;
use InvalidArgumentException;
use UnexpectedValueException;

/**
* A trait that provides a set of static methods to manage configuration
Expand Down
4 changes: 3 additions & 1 deletion src/Database/Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@
*/
namespace Cake\Database;

use Cake\Core\Exception;

/**
* Exception for the database package.
*/
class Exception extends \Cake\Core\Exception\Exception
class Exception extends Exception
{

}
2 changes: 1 addition & 1 deletion src/Database/Exception/MissingDriverException.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

use Cake\Core\Exception\Exception;

class MissingDriverException extends \Cake\Core\Exception\Exception
class MissingDriverException extends Exception
{

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Database/Exception/MissingExtensionException.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

use Cake\Core\Exception\Exception;

class MissingExtensionException extends \Cake\Core\Exception\Exception
class MissingExtensionException extends Exception
{

/**
Expand Down
3 changes: 0 additions & 3 deletions src/Database/Expression/FieldTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
*/
namespace Cake\Database\Expression;

use Cake\Database\ExpressionInterface;
use Cake\Database\ValueBinder;

/**
* Contains the field property with a getter and a setter for it
*
Expand Down
3 changes: 2 additions & 1 deletion src/Database/Type/BinaryType.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
namespace Cake\Database\Type;

use Cake\Core\Exception\Exception;
use Cake\Database\Type;
use Cake\Database\Driver;
use PDO;

Expand All @@ -23,7 +24,7 @@
*
* Use to convert binary data between PHP and the database types.
*/
class BinaryType extends \Cake\Database\Type
class BinaryType extends Type
{

/**
Expand Down
3 changes: 2 additions & 1 deletion src/Database/Type/DateTimeType.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@
namespace Cake\Database\Type;

use Cake\Database\Driver;
use Cake\Database\Type;

/**
* Datetime type converter.
*
* Use to convert datetime instances to strings & back.
*/
class DateTimeType extends \Cake\Database\Type
class DateTimeType extends Type
{

/**
Expand Down
3 changes: 2 additions & 1 deletion src/Database/Type/DateType.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
namespace Cake\Database\Type;

use Cake\Database\Driver;
use Cake\Database\Type\DateTimeType;

class DateType extends \Cake\Database\Type\DateTimeType
class DateType extends DateTimeType
{

/**
Expand Down
3 changes: 2 additions & 1 deletion src/Database/Type/FloatType.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@
namespace Cake\Database\Type;

use Cake\Database\Driver;
use Cake\Database\Type;
use PDO;

/**
* Float type converter.
*
* Use to convert float/decimal data between PHP and the database types.
*/
class FloatType extends \Cake\Database\Type
class FloatType extends Type
{

/**
Expand Down
3 changes: 2 additions & 1 deletion src/Database/Type/IntegerType.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@
namespace Cake\Database\Type;

use Cake\Database\Driver;
use Cake\Database\Type;
use PDO;

/**
* Integer type converter.
*
* Use to convert integer data between PHP and the database types.
*/
class IntegerType extends \Cake\Database\Type
class IntegerType extends Type
{

/**
Expand Down
4 changes: 3 additions & 1 deletion src/Database/Type/TimeType.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@
*/
namespace Cake\Database\Type;

use Cake\Database\Type\DateTimeType;

/**
* Time type converter.
*
* Use to convert time instances to strings & back.
*/
class TimeType extends \Cake\Database\Type\DateTimeType
class TimeType extends DateTimeType
{

/**
Expand Down
3 changes: 2 additions & 1 deletion src/Database/Type/UuidType.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@
namespace Cake\Database\Type;

use Cake\Database\Driver;
use Cake\Database\Type;
use Cake\Utility\Text;
use PDO;

/**
* Provides behavior for the uuid type
*/
class UuidType extends \Cake\Database\Type
class UuidType extends Type
{

/**
Expand Down
3 changes: 2 additions & 1 deletion src/Network/Http/FormData.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
*/
namespace Cake\Network\Http;

use Countable;
use Cake\Network\Http\FormData\Part;

/**
Expand All @@ -23,7 +24,7 @@
* and files.
*
*/
class FormData implements \Countable
class FormData implements Countable
{

/**
Expand Down
3 changes: 2 additions & 1 deletion src/Network/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/
namespace Cake\Network;

use ArrayAccess;
use BadMethodCallException;
use Cake\Core\Configure;
use Cake\Network\Exception\MethodNotAllowedException;
Expand All @@ -28,7 +29,7 @@
*
* `$request['controller']` or `$request->controller`.
*/
class Request implements \ArrayAccess
class Request implements ArrayAccess
{

/**
Expand Down
1 change: 0 additions & 1 deletion src/ORM/Association/SelectableAssociationTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
*/
namespace Cake\ORM\Association;

use Cake\Database\ExpressionInterface;
use Cake\Database\Expression\IdentifierExpression;
use Cake\Database\Expression\TupleComparison;

Expand Down
1 change: 0 additions & 1 deletion src/ORM/Behavior/CounterCacheBehavior.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
use Cake\ORM\Association;
use Cake\ORM\Behavior;
use Cake\ORM\Entity;
use Cake\ORM\Table;

/**
* CounterCache behavior
Expand Down
1 change: 0 additions & 1 deletion src/ORM/Behavior/TimestampBehavior.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
use Cake\I18n\Time;
use Cake\ORM\Behavior;
use Cake\ORM\Entity;
use Cake\ORM\Table;

class TimestampBehavior extends Behavior
{
Expand Down
1 change: 0 additions & 1 deletion src/ORM/Behavior/TreeBehavior.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
use Cake\ORM\Behavior;
use Cake\ORM\Entity;
use Cake\ORM\Query;
use Cake\ORM\Table;

/**
* Makes the table to which this is attached to behave like a nested set and
Expand Down
1 change: 0 additions & 1 deletion src/ORM/ResultSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
use Cake\Database\Exception;
use Cake\Database\Type;
use Cake\Datasource\ResultSetInterface;
use JsonSerializable;
use SplFixedArray;

/**
Expand Down
1 change: 0 additions & 1 deletion src/ORM/Table.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
use Cake\ORM\Rule\IsUnique;
use Cake\Utility\Inflector;
use Cake\Validation\Validator;
use RuntimeException;

/**
* Represents a single database table.
Expand Down
1 change: 0 additions & 1 deletion src/Routing/Filter/ControllerFactoryFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
use Cake\Core\App;
use Cake\Event\Event;
use Cake\Routing\DispatcherFilter;
use Cake\Utility\Inflector;

/**
* A dispatcher filter that builds the controller to dispatch
Expand Down
1 change: 0 additions & 1 deletion src/TestSuite/TestSuite.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
namespace Cake\TestSuite;

use Cake\Filesystem\Folder;

/**
* A class to contain test cases and run them with shared fixtures
*
Expand Down
6 changes: 5 additions & 1 deletion src/Validation/ValidationSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,15 @@
*/
namespace Cake\Validation;

use ArrayAccess;
use IteratorAggregate;
use Countable;

/**
* ValidationSet object. Holds all validation rules for a field and exposes
* methods to dynamically add or remove validation rules
*/
class ValidationSet implements \ArrayAccess, \IteratorAggregate, \Countable
class ValidationSet implements ArrayAccess, IteratorAggregate, Countable
{

/**
Expand Down
6 changes: 5 additions & 1 deletion src/Validation/Validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
*/
namespace Cake\Validation;

use ArrayAccess;
use IteratorAggregate;
use Countable;

use Cake\Validation\RulesProvider;
use Cake\Validation\ValidationSet;

Expand All @@ -25,7 +29,7 @@
*
* @link http://book.cakephp.org/3.0/en/core-libraries/validation.html
*/
class Validator implements \ArrayAccess, \IteratorAggregate, \Countable
class Validator implements ArrayAccess, IteratorAggregate, Countable
{

/**
Expand Down
1 change: 0 additions & 1 deletion src/View/Form/FormContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
*/
namespace Cake\View\Form;

use Cake\Form\Form;
use Cake\Network\Request;
use Cake\View\Form\ContextInterface;

Expand Down
2 changes: 1 addition & 1 deletion src/View/Helper/FormHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -2231,7 +2231,7 @@ protected function _datetimeOptions($options)
unset($options['interval'], $options['round']);

if (!isset($options['val'])) {
$val = new \DateTime();
$val = new DateTime();
$currentYear = $val->format('Y');
if (isset($options['year']['end']) && $options['year']['end'] < $currentYear) {
$val->setDate($options['year']['end'], $val->format('n'), $val->format('j'));
Expand Down

0 comments on commit 0b41e2c

Please sign in to comment.