Skip to content

Commit 7114f67

Browse files
php cs fixer to honor our bullet :)
1 parent eec20e0 commit 7114f67

24 files changed

+192
-179
lines changed

src/Adapter/AbstractServiceAdapter.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@
33
* Created by PhpStorm.
44
* User: Ricardo Fiorani
55
* Date: 29/08/2015
6-
* Time: 19:37
6+
* Time: 19:37.
77
*/
8-
98
namespace RicardoFiorani\Adapter;
109

11-
1210
use RicardoFiorani\Exception\NotEmbeddableException;
1311
use RicardoFiorani\Renderer\EmbedRendererInterface;
1412

@@ -36,8 +34,9 @@ abstract class AbstractServiceAdapter implements VideoAdapterInterface
3634

3735
/**
3836
* AbstractVideoAdapter constructor.
39-
* @param string $url
40-
* @param string $pattern
37+
*
38+
* @param string $url
39+
* @param string $pattern
4140
* @param EmbedRendererInterface $renderer
4241
*/
4342
public function __construct($url, $pattern, EmbedRendererInterface $renderer)
@@ -48,7 +47,8 @@ public function __construct($url, $pattern, EmbedRendererInterface $renderer)
4847
}
4948

5049
/**
51-
* Returns the input URL
50+
* Returns the input URL.
51+
*
5252
* @return string
5353
*/
5454
public function getRawUrl()
@@ -113,10 +113,12 @@ public function setRenderer($renderer)
113113
}
114114

115115
/**
116-
* @param int $width
117-
* @param int $height
116+
* @param int $width
117+
* @param int $height
118118
* @param bool $autoplay
119+
*
119120
* @return string
121+
*
120122
* @throws NotEmbeddableException
121123
*/
122124
public function getEmbedCode($width, $height, $autoplay = false)
@@ -127,6 +129,4 @@ public function getEmbedCode($width, $height, $autoplay = false)
127129

128130
return $this->getRenderer()->render($this->getEmbedUrl($autoplay), $width, $height);
129131
}
130-
131-
132132
}

src/Adapter/Dailymotion/DailymotionServiceAdapter.php

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
* Created by PhpStorm.
44
* User: Ricardo Fiorani
55
* Date: 30/08/2015
6-
* Time: 14:38
6+
* Time: 14:38.
77
*/
8-
98
namespace RicardoFiorani\Adapter\Dailymotion;
109

1110
use RicardoFiorani\Adapter\AbstractServiceAdapter;
@@ -18,8 +17,9 @@ class DailymotionServiceAdapter extends AbstractServiceAdapter
1817

1918
/**
2019
* AbstractVideoAdapter constructor.
21-
* @param string $url
22-
* @param string $pattern
20+
*
21+
* @param string $url
22+
* @param string $pattern
2323
* @param EmbedRendererInterface $renderer
2424
*/
2525
public function __construct($url, $pattern, EmbedRendererInterface $renderer)
@@ -30,9 +30,9 @@ public function __construct($url, $pattern, EmbedRendererInterface $renderer)
3030
return parent::__construct($url, $pattern, $renderer);
3131
}
3232

33-
3433
/**
35-
* Returns the service name (ie: "Youtube" or "Vimeo")
34+
* Returns the service name (ie: "Youtube" or "Vimeo").
35+
*
3636
* @return string
3737
*/
3838
public function getServiceName()
@@ -41,7 +41,8 @@ public function getServiceName()
4141
}
4242

4343
/**
44-
* Returns if the service has a thumbnail image
44+
* Returns if the service has a thumbnail image.
45+
*
4546
* @return bool
4647
*/
4748
public function hasThumbnail()
@@ -50,7 +51,8 @@ public function hasThumbnail()
5051
}
5152

5253
/**
53-
* Returns all thumbnails available sizes
54+
* Returns all thumbnails available sizes.
55+
*
5456
* @return array
5557
*/
5658
public function getThumbNailSizes()
@@ -62,20 +64,23 @@ public function getThumbNailSizes()
6264

6365
/**
6466
* @param string $size
67+
*
6568
* @return string
69+
*
6670
* @throws InvalidThumbnailSizeException
6771
*/
6872
public function getThumbnail($size)
6973
{
7074
if (false == in_array($size, $this->getThumbNailSizes())) {
71-
throw new InvalidThumbnailSizeException;
75+
throw new InvalidThumbnailSizeException();
7276
}
7377

74-
return 'http://www.dailymotion.com/' . $size . '/video/' . $this->videoId;
78+
return 'http://www.dailymotion.com/'.$size.'/video/'.$this->videoId;
7579
}
7680

7781
/**
78-
* Returns the small thumbnail's url
82+
* Returns the small thumbnail's url.
83+
*
7984
* @return string
8085
*/
8186
public function getSmallThumbnail()
@@ -85,7 +90,8 @@ public function getSmallThumbnail()
8590
}
8691

8792
/**
88-
* Returns the medium thumbnail's url
93+
* Returns the medium thumbnail's url.
94+
*
8995
* @return string
9096
*/
9197
public function getMediumThumbnail()
@@ -95,7 +101,8 @@ public function getMediumThumbnail()
95101
}
96102

97103
/**
98-
* Returns the large thumbnail's url
104+
* Returns the large thumbnail's url.
105+
*
99106
* @return string
100107
*/
101108
public function getLargeThumbnail()
@@ -105,7 +112,8 @@ public function getLargeThumbnail()
105112
}
106113

107114
/**
108-
* Returns the largest thumnbnaail's url
115+
* Returns the largest thumnbnaail's url.
116+
*
109117
* @return string
110118
*/
111119
public function getLargestThumbnail()
@@ -116,11 +124,12 @@ public function getLargestThumbnail()
116124

117125
/**
118126
* @param bool $autoplay
127+
*
119128
* @return string
120129
*/
121130
public function getEmbedUrl($autoplay = false)
122131
{
123-
return '//www.dailymotion.com/embed/video/' . $this->videoId . ($autoplay ? '?amp&autoplay=1' : '');
132+
return '//www.dailymotion.com/embed/video/'.$this->videoId.($autoplay ? '?amp&autoplay=1' : '');
124133
}
125134

126135
/**

src/Adapter/Dailymotion/Factory/DailymotionServiceAdapterFactory.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@
33
* Created by PhpStorm.
44
* User: Ricardo Fiorani
55
* Date: 30/08/2015
6-
* Time: 14:40
6+
* Time: 14:40.
77
*/
8-
98
namespace RicardoFiorani\Adapter\Dailymotion\Factory;
109

11-
1210
use RicardoFiorani\Adapter\Dailymotion\DailymotionServiceAdapter;
1311
use RicardoFiorani\Adapter\Factory\CallableServiceAdapterFactoryInterface;
1412
use RicardoFiorani\Adapter\VideoAdapterInterface;
@@ -17,9 +15,10 @@
1715
class DailymotionServiceAdapterFactory implements CallableServiceAdapterFactoryInterface
1816
{
1917
/**
20-
* @param string $url
21-
* @param string $pattern
18+
* @param string $url
19+
* @param string $pattern
2220
* @param EmbedRendererInterface $renderer
21+
*
2322
* @return VideoAdapterInterface
2423
*/
2524
public function __invoke($url, $pattern, EmbedRendererInterface $renderer)

src/Adapter/Facebook/FacebookServiceAdapter.php

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,39 +3,38 @@
33
* Created by PhpStorm.
44
* User: Ricardo Fiorani
55
* Date: 02/09/2015
6-
* Time: 22:42
6+
* Time: 22:42.
77
*/
8-
98
namespace RicardoFiorani\Adapter\Facebook;
109

11-
1210
use RicardoFiorani\Adapter\AbstractServiceAdapter;
1311
use RicardoFiorani\Exception\InvalidThumbnailSizeException;
1412
use RicardoFiorani\Exception\ThumbnailSizeNotAvailable;
1513
use RicardoFiorani\Renderer\EmbedRendererInterface;
1614

1715
class FacebookServiceAdapter extends AbstractServiceAdapter
1816
{
19-
2017
const THUMBNAIL_SIZE_DEFAULT = 'default';
2118

2219
/**
2320
* AbstractVideoAdapter constructor.
24-
* @param string $url
25-
* @param string $pattern
21+
*
22+
* @param string $url
23+
* @param string $pattern
2624
* @param EmbedRendererInterface $renderer
2725
*/
2826
public function __construct($url, $pattern, EmbedRendererInterface $renderer)
2927
{
3028
$match = array();
3129
preg_match($pattern, $url, $match);
3230
$this->setVideoId($match[1]);
31+
3332
return parent::__construct($url, $pattern, $renderer);
3433
}
3534

36-
3735
/**
38-
* Returns the service name (ie: "Youtube" or "Vimeo")
36+
* Returns the service name (ie: "Youtube" or "Vimeo").
37+
*
3938
* @return string
4039
*/
4140
public function getServiceName()
@@ -44,7 +43,8 @@ public function getServiceName()
4443
}
4544

4645
/**
47-
* Returns if the service has a thumbnail image
46+
* Returns if the service has a thumbnail image.
47+
*
4848
* @return bool
4949
*/
5050
public function hasThumbnail()
@@ -53,7 +53,8 @@ public function hasThumbnail()
5353
}
5454

5555
/**
56-
* Returns all thumbnails available sizes
56+
* Returns all thumbnails available sizes.
57+
*
5758
* @return array
5859
*/
5960
public function getThumbNailSizes()
@@ -63,30 +64,35 @@ public function getThumbNailSizes()
6364

6465
/**
6566
* @param string $size
67+
*
6668
* @return string
69+
*
6770
* @throws InvalidThumbnailSizeException
6871
*/
6972
public function getThumbnail($size)
7073
{
7174
if (false == in_array($size, $this->getThumbNailSizes())) {
72-
throw new InvalidThumbnailSizeException;
75+
throw new InvalidThumbnailSizeException();
7376
}
7477

75-
return 'https://graph.facebook.com/' . $this->getVideoId() . '/picture';
78+
return 'https://graph.facebook.com/'.$this->getVideoId().'/picture';
7679
}
7780

7881
/**
79-
* Returns the small thumbnail's url
82+
* Returns the small thumbnail's url.
83+
*
8084
* @return string
85+
*
8186
* @throws ThumbnailSizeNotAvailable
8287
*/
8388
public function getSmallThumbnail()
8489
{
85-
throw new ThumbnailSizeNotAvailable;
90+
throw new ThumbnailSizeNotAvailable();
8691
}
8792

8893
/**
89-
* Returns the medium thumbnail's url
94+
* Returns the medium thumbnail's url.
95+
*
9096
* @return string
9197
*/
9298
public function getMediumThumbnail()
@@ -95,17 +101,20 @@ public function getMediumThumbnail()
95101
}
96102

97103
/**
98-
* Returns the large thumbnail's url
104+
* Returns the large thumbnail's url.
105+
*
99106
* @return string
107+
*
100108
* @throws ThumbnailSizeNotAvailable
101109
*/
102110
public function getLargeThumbnail()
103111
{
104-
throw new ThumbnailSizeNotAvailable;
112+
throw new ThumbnailSizeNotAvailable();
105113
}
106114

107115
/**
108-
* Returns the largest thumnbnaail's url
116+
* Returns the largest thumnbnaail's url.
117+
*
109118
* @return string
110119
*/
111120
public function getLargestThumbnail()
@@ -115,11 +124,12 @@ public function getLargestThumbnail()
115124

116125
/**
117126
* @param bool $autoplay
127+
*
118128
* @return string
119129
*/
120130
public function getEmbedUrl($autoplay = false)
121131
{
122-
return 'https://www.facebook.com/video/embed?video_id=' . $this->getVideoId();
132+
return 'https://www.facebook.com/video/embed?video_id='.$this->getVideoId();
123133
}
124134

125135
/**

src/Adapter/Facebook/Factory/FacebookServiceAdapterFactory.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,26 @@
33
* Created by PhpStorm.
44
* User: Ricardo Fiorani
55
* Date: 02/09/2015
6-
* Time: 22:41
6+
* Time: 22:41.
77
*/
8-
98
namespace RicardoFiorani\Adapter\Facebook\Factory;
109

11-
1210
use RicardoFiorani\Adapter\Facebook\FacebookServiceAdapter;
1311
use RicardoFiorani\Adapter\Factory\CallableServiceAdapterFactoryInterface;
1412
use RicardoFiorani\Adapter\VideoAdapterInterface;
1513
use RicardoFiorani\Renderer\EmbedRendererInterface;
1614

1715
class FacebookServiceAdapterFactory implements CallableServiceAdapterFactoryInterface
1816
{
19-
2017
/**
21-
* @param string $url
22-
* @param string $pattern
18+
* @param string $url
19+
* @param string $pattern
2320
* @param EmbedRendererInterface $renderer
21+
*
2422
* @return VideoAdapterInterface
2523
*/
2624
public function __invoke($url, $pattern, EmbedRendererInterface $renderer)
2725
{
2826
return new FacebookServiceAdapter($url, $pattern, $renderer);
2927
}
30-
}
28+
}

0 commit comments

Comments
 (0)