Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8eed6f9

Browse files
author
Dominik Liebler
committed
Merge pull request DesignPatternsPHP#130 from nueckman/codestyle-1
codestyle - remove trailing whitespaces
2 parents 6b910fa + 2bc3d20 commit 8eed6f9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+40
-65
lines changed

Behavioral/Command/HelloCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
/**
66
* This concrete command calls "print" on the Receiver, but an external
7-
* invoker just know he can call "execute"
7+
* invoker just know he can call "execute"
88
*/
99
class HelloCommand implements CommandInterface
1010
{

Behavioral/NullObject/LoggerInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
/**
66
* LoggerInterface is a contract for logging something
7-
*
7+
*
88
* Key feature: NullLogger MUST inherit from this interface like any other Loggers
99
*/
1010
interface LoggerInterface

Behavioral/NullObject/NullLogger.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/**
66
* Performance concerns : ok there is a call for nothing but we spare an "if is_null"
77
* I didn't run a benchmark but I think it's equivalent.
8-
*
8+
*
99
* Key feature : of course this logger MUST implement the same interface (or abstract)
1010
* like the other loggers.
1111
*/

Behavioral/Observer/User.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
/**
66
* Observer pattern : The observed object (the subject)
7-
*
7+
*
88
* The subject maintains a list of Observers and sends notifications.
99
*
1010
*/

Behavioral/Observer/UserObserver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class UserObserver implements \SplObserver
1010
/**
1111
* This is the only method to implement as an observer.
1212
* It is called by the Subject (usually by SplSubject::notify() )
13-
*
13+
*
1414
* @param \SplSubject $subject
1515
*/
1616
public function update(\SplSubject $subject)

Behavioral/Specification/Either.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class Either extends AbstractSpecification
1212

1313
/**
1414
* A composite wrapper of two specifications
15-
*
15+
*
1616
* @param SpecificationInterface $left
1717
* @param SpecificationInterface $right
1818
*/
@@ -24,9 +24,9 @@ public function __construct(SpecificationInterface $left, SpecificationInterface
2424

2525
/**
2626
* Returns the evaluation of both wrapped specifications as a logical OR
27-
*
27+
*
2828
* @param Item $item
29-
*
29+
*
3030
* @return bool
3131
*/
3232
public function isSatisfiedBy(Item $item)

Behavioral/Specification/Item.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class Item
1010

1111
/**
1212
* An item must have a price
13-
*
13+
*
1414
* @param int $price
1515
*/
1616
public function __construct($price)
@@ -20,7 +20,7 @@ public function __construct($price)
2020

2121
/**
2222
* Get the items price
23-
*
23+
*
2424
* @return int
2525
*/
2626
public function getPrice()

Behavioral/Specification/Not.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class Not extends AbstractSpecification
1111

1212
/**
1313
* Creates a new specification wrapping another
14-
*
14+
*
1515
* @param SpecificationInterface $spec
1616
*/
1717
public function __construct(SpecificationInterface $spec)
@@ -21,9 +21,9 @@ public function __construct(SpecificationInterface $spec)
2121

2222
/**
2323
* Returns the negated result of the wrapped specification
24-
*
24+
*
2525
* @param Item $item
26-
*
26+
*
2727
* @return bool
2828
*/
2929
public function isSatisfiedBy(Item $item)

Behavioral/TemplateMethod/Journey.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ abstract class Journey
1010
/**
1111
* This is the public service provided by this class and its subclasses.
1212
* Notice it is final to "freeze" the global behavior of algorithm.
13-
* If you want to override this contract, make an interface with only takeATrip()
13+
* If you want to override this contract, make an interface with only takeATrip()
1414
* and subclass it.
1515
*/
1616
final public function takeATrip()

Behavioral/Visitor/RoleVisitorInterface.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,25 @@
66
* Visitor Pattern
77
*
88
* The contract for the visitor.
9-
*
9+
*
1010
* Note 1 : in C++ or java, with method polymorphism based on type-hint, there are many
1111
* methods visit() with different type for the 'role' parameter.
12-
*
12+
*
1313
* Note 2 : the visitor must not choose itself which method to
1414
* invoke, it is the Visitee that make this decision.
1515
*/
1616
interface RoleVisitorInterface
1717
{
1818
/**
1919
* Visit a User object
20-
*
20+
*
2121
* @param \DesignPatterns\Behavioral\Visitor\User $role
2222
*/
2323
public function visitUser(User $role);
2424

2525
/**
2626
* Visit a Group object
27-
*
27+
*
2828
* @param \DesignPatterns\Behavioral\Visitor\Group $role
2929
*/
3030
public function visitGroup(Group $role);

Creational/AbstractFactory/AbstractFactory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ abstract class AbstractFactory
2121
{
2222
/**
2323
* Creates a text component
24-
*
24+
*
2525
* @param string $content
2626
*
2727
* @return Text
@@ -30,7 +30,7 @@ abstract public function createText($content);
3030

3131
/**
3232
* Creates a picture component
33-
*
33+
*
3434
* @param string $path
3535
* @param string $name
3636
*

Creational/AbstractFactory/Tests/AbstractFactoryTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ public function getFactories()
2121

2222
/**
2323
* This is the client of factories. Note that the client does not
24-
* care which factory is given to him, he can create any component he
24+
* care which factory is given to him, he can create any component he
2525
* wants and render how he wants.
26-
*
26+
*
2727
* @dataProvider getFactories
2828
*/
2929
public function testComponentCreation(AbstractFactory $factory)

Creational/Builder/BikeBuilder.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ class BikeBuilder implements BuilderInterface
1717
*/
1818
public function addDoors()
1919
{
20-
2120
}
2221

2322
/**

Creational/Builder/Director.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
/**
66
* Director is part of the builder pattern. It knows the interface of the builder
7-
* and builds a complex object with the help of the builder.
8-
*
7+
* and builds a complex object with the help of the builder.
8+
*
99
* You can also inject many builders instead of one to build more complex objects
1010
*/
1111
class Director

Creational/Builder/Parts/Bike.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,4 @@
77
*/
88
class Bike extends Vehicle
99
{
10-
1110
}

Creational/Builder/Parts/Car.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,4 @@
77
*/
88
class Car extends Vehicle
99
{
10-
1110
}

Creational/Builder/Parts/Door.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,4 @@
77
*/
88
class Door
99
{
10-
1110
}

Creational/Builder/Parts/Engine.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,4 @@
77
*/
88
class Engine
99
{
10-
1110
}

Creational/Builder/Parts/Wheel.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,4 @@
77
*/
88
class Wheel
99
{
10-
1110
}

Creational/Builder/Tests/DirectorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function getBuilder()
3131
/**
3232
* Here we test the build process. Notice that the client don't know
3333
* anything about the concrete builder.
34-
*
34+
*
3535
* @dataProvider getBuilder
3636
*/
3737
public function testBuild(BuilderInterface $builder)

Creational/FactoryMethod/FactoryMethod.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,20 @@ abstract class FactoryMethod
1313

1414
/**
1515
* The children of the class must implement this method
16-
*
16+
*
1717
* Sometimes this method can be public to get "raw" object
18-
*
18+
*
1919
* @param string $type a generic type
20-
*
20+
*
2121
* @return VehicleInterface a new vehicle
2222
*/
2323
abstract protected function createVehicle($type);
2424

2525
/**
2626
* Creates a new vehicle
27-
*
27+
*
2828
* @param int $type
29-
*
29+
*
3030
* @return VehicleInterface a new vehicle
3131
*/
3232
public function create($type)

Creational/FactoryMethod/Porsche.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,5 @@ public function setColor($rgb)
2626
*/
2727
public function addTuningAMG()
2828
{
29-
3029
}
3130
}

Creational/Multiton/Multiton.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,12 @@ class Multiton
3232
*/
3333
private function __construct()
3434
{
35-
3635
}
3736

3837
/**
3938
* gets the instance with the given name, e.g. Multiton::INSTANCE_1
4039
* uses lazy initialization
41-
*
40+
*
4241
* @param string $instanceName
4342
*
4443
* @return Multiton
@@ -59,7 +58,6 @@ public static function getInstance($instanceName)
5958
*/
6059
private function __clone()
6160
{
62-
6361
}
6462

6563
/**
@@ -69,6 +67,5 @@ private function __clone()
6967
*/
7068
private function __wakeup()
7169
{
72-
7370
}
7471
}

Creational/Pool/Tests/TestWorker.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php
1+
<?php
22

33
namespace DesignPatterns\Creational\Pool\Tests;
44

Creational/Prototype/BarBookPrototype.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,5 @@ class BarBookPrototype extends BookPrototype
1717
*/
1818
public function __clone()
1919
{
20-
2120
}
2221
}

Creational/Prototype/FooBookPrototype.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,5 @@ class FooBookPrototype extends BookPrototype
1414
*/
1515
public function __clone()
1616
{
17-
1817
}
1918
}

Creational/SimpleFactory/Bicycle.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,5 @@ class Bicycle implements VehicleInterface
1414
*/
1515
public function driveTo($destination)
1616
{
17-
1817
}
1918
}

Creational/SimpleFactory/ConcreteFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function __construct()
2626

2727
/**
2828
* Creates a vehicle
29-
*
29+
*
3030
* @param string $type a known type key
3131
*
3232
* @return VehicleInterface a new instance of VehicleInterface

Creational/SimpleFactory/Scooter.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,5 @@ class Scooter implements VehicleInterface
1212
*/
1313
public function driveTo($destination)
1414
{
15-
1615
}
1716
}

Creational/Singleton/Singleton.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ class Singleton
1919
*/
2020
public static function getInstance()
2121
{
22-
2322
if (null === static::$instance) {
2423
static::$instance = new static;
2524
}
@@ -33,7 +32,6 @@ public static function getInstance()
3332
*/
3433
private function __construct()
3534
{
36-
3735
}
3836

3937
/**
@@ -43,7 +41,6 @@ private function __construct()
4341
*/
4442
private function __clone()
4543
{
46-
4744
}
4845

4946
/**
@@ -53,6 +50,5 @@ private function __clone()
5350
*/
5451
private function __wakeup()
5552
{
56-
5753
}
5854
}

Creational/StaticFactory/FormatNumber.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,4 @@
77
*/
88
class FormatNumber implements FormatterInterface
99
{
10-
1110
}

Creational/StaticFactory/FormatString.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,4 @@
77
*/
88
class FormatString implements FormatterInterface
99
{
10-
1110
}

Creational/StaticFactory/FormatterInterface.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,4 @@
77
*/
88
interface FormatterInterface
99
{
10-
1110
}

More/Repository/PostRepository.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
/**
66
* Repository for class Post
77
* This class is between Entity layer(class Post) and access object layer(interface Storage)
8-
*
8+
*
99
* Repository encapsulates the set of objects persisted in a data store and the operations performed over them
1010
* providing a more object-oriented view of the persistence layer
11-
*
11+
*
1212
* Repository also supports the objective of achieving a clean separation and one-way dependency
1313
* between the domain and data mapping layers
1414
*

0 commit comments

Comments
 (0)