1
- # Functional Example of Registering a DailyMotion Service
1
+ # Functional Example of Registering a Dailymotion Service
2
2
3
- ## DailyMotionServiceAdapter Class (The Service Adapter Itself)
3
+ ## DailymotionServiceAdapter Class (The Service Adapter Itself)
4
4
``` php
5
5
<?php
6
6
namespace MyVendor\ServiceAdapter;
@@ -9,7 +9,7 @@ use RicardoFiorani\Adapter\AbstractServiceAdapter;
9
9
use RicardoFiorani\Renderer\EmbedRendererInterface;
10
10
11
11
//Your service Adapter must implement VideoAdapterInterface or Extend AbstractServiceAdapter
12
- class DailyMotionServiceAdapter extends AbstractServiceAdapter
12
+ class DailymotionServiceAdapter extends AbstractServiceAdapter
13
13
{
14
14
const THUMBNAIL_DEFAULT = 'thumbnail';
15
15
@@ -34,7 +34,7 @@ class DailyMotionServiceAdapter extends AbstractServiceAdapter
34
34
*/
35
35
public function getServiceName()
36
36
{
37
- return 'DailyMotion ';
37
+ return 'Dailymotion ';
38
38
}
39
39
40
40
/**
@@ -128,17 +128,17 @@ class DailyMotionServiceAdapter extends AbstractServiceAdapter
128
128
}
129
129
}
130
130
```
131
- ## The DailyMotionServiceAdapterFactory
131
+ ## The DailymotionServiceAdapterFactory
132
132
``` php
133
133
<?php
134
134
namespace MyVendor\ServiceAdapter\Factory;
135
135
136
136
137
- use MyVendor\ServiceAdapter\DailyMotionServiceAdapter ;
137
+ use MyVendor\ServiceAdapter\DailymotionServiceAdapter ;
138
138
use RicardoFiorani\Adapter\VideoAdapterInterface;
139
139
use RicardoFiorani\Renderer\EmbedRendererInterface;
140
140
141
- class DailyMotionServiceAdapterFactory implements \RicardoFiorani\Adapter\Factory\CallableServiceAdapterFactoryInterface
141
+ class DailymotionServiceAdapterFactory implements \RicardoFiorani\Adapter\Factory\CallableServiceAdapterFactoryInterface
142
142
{
143
143
/**
144
144
* @param string $url
@@ -148,7 +148,7 @@ class DailyMotionServiceAdapterFactory implements \RicardoFiorani\Adapter\Factor
148
148
*/
149
149
public function __invoke($url, $pattern, EmbedRendererInterface $renderer)
150
150
{
151
- $dailyMotionServiceAdapter = new DailyMotionServiceAdapter ($url, $pattern, $renderer);
151
+ $dailyMotionServiceAdapter = new DailymotionServiceAdapter ($url, $pattern, $renderer);
152
152
153
153
return $dailyMotionServiceAdapter;
154
154
}
@@ -165,7 +165,7 @@ require __DIR__ . '/vendor/autoload.php';
165
165
166
166
$vsd = new VideoServiceDetector();
167
167
//The Service Name
168
- $serviceName = 'DailyMotion ';
168
+ $serviceName = 'Dailymotion ';
169
169
170
170
//The Pattern used to identify this service
171
171
//You can use multiple, but make sure your ServiceAdapter can handle it properly
@@ -174,9 +174,9 @@ $patterns = array(
174
174
);
175
175
176
176
//Register the new service
177
- $vsd->getServiceContainer()->registerService($serviceName, $patterns, "\\MyVendor\\ServiceAdapter\\Factory\\DailyMotionServiceAdapterFactory ");
177
+ $vsd->getServiceContainer()->registerService($serviceName, $patterns, "\\MyVendor\\ServiceAdapter\\Factory\\DailymotionServiceAdapterFactory ");
178
178
179
- //This will get you an DailyMotionServiceAdapter
179
+ //This will get you an DailymotionServiceAdapter
180
180
$video = $vsd->parse('http://www.dailymotion.com/video/x33ncwc_kittens-fight-in-tiny-boxing-ring_animals');
181
181
182
182
```
0 commit comments