Skip to content
This repository has been archived by the owner on Oct 28, 2020. It is now read-only.

Commit

Permalink
fix cs
Browse files Browse the repository at this point in the history
  • Loading branch information
kbond committed Nov 12, 2014
1 parent c6f9783 commit 0c92970
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 27 deletions.
4 changes: 2 additions & 2 deletions Command/HttpCacheWarmupCommand.php
Expand Up @@ -41,7 +41,7 @@ protected function configure()
array(
new InputOption('parallel-requests', 'p', InputOption::VALUE_REQUIRED | InputOption::VALUE_REQUIRED, 'The number of requests to send in parallel', '10'),
new InputOption('timeout', 't', InputOption::VALUE_REQUIRED | InputOption::VALUE_REQUIRED, 'The timeout in seconds', '10'),
new InputOption('follow-redirects', 'r', InputOption::VALUE_NONE, 'Follow redirects?')
new InputOption('follow-redirects', 'r', InputOption::VALUE_NONE, 'Follow redirects?'),
)
)
->setDescription('Warms up an http cache')
Expand Down Expand Up @@ -102,7 +102,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$table->setHeaders(array('Code', 'Reason', 'Count'));

foreach ($summary as $code => $count) {
$table->addRow(array($code, Response::getStatusText($code) ,$count));
$table->addRow(array($code, Response::getStatusText($code), $count));
}

$table->addRow(new TableSeparator());
Expand Down
2 changes: 1 addition & 1 deletion DependencyInjection/ZenstruckCacheExtension.php
Expand Up @@ -20,7 +20,7 @@ class ZenstruckCacheExtension extends ConfigurableExtension
*/
protected function loadInternal(array $mergedConfig, ContainerBuilder $container)
{
$loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
$loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('services.xml');

$client = new Definition(ClientFactory::getBestClass());
Expand Down
4 changes: 2 additions & 2 deletions Http/Guzzle4Client.php
Expand Up @@ -92,8 +92,8 @@ private function createResponse(ResponseInterface $guzzleResponse)
{
return new Response(
$guzzleResponse->getEffectiveUrl(),
(string)$guzzleResponse->getBody(),
(int)$guzzleResponse->getStatusCode(),
(string) $guzzleResponse->getBody(),
(int) $guzzleResponse->getStatusCode(),
$guzzleResponse->getHeaders()
);
}
Expand Down
6 changes: 3 additions & 3 deletions Tests/CrawlerTest.php
Expand Up @@ -41,7 +41,7 @@ public function testCrawl()
$this->returnValue(
array(
new Response('foo.com'),
new Response('bar.com')
new Response('bar.com'),
)
)
)
Expand All @@ -54,7 +54,7 @@ public function testCrawl()
->will(
$this->returnValue(
array(
new Response('baz.com', '', 404)
new Response('baz.com', '', 404),
)
)
)
Expand All @@ -77,7 +77,7 @@ public function testCrawl()
$codes = array();
$callback = function (Response $response) use (&$codes) {
$codes[] = $response->getStatusCode();
} ;
};

$crawler->crawl(2, false, 10, $callback);

Expand Down
Expand Up @@ -28,7 +28,7 @@ public function testProcess()
'zenstruck_cache.crawler',
'addUrlProvider',
array(
new Reference('my_provider')
new Reference('my_provider'),
)
);
}
Expand Down
8 changes: 4 additions & 4 deletions Tests/DependencyInjection/ZenstruckCacheExtensionTest.php
Expand Up @@ -25,8 +25,8 @@ public function testWithHost()
$this->load(
array(
'sitemap_provider' => array(
'host' => 'http://www.example.com'
)
'host' => 'http://www.example.com',
),
)
);
$this->compile();
Expand All @@ -44,8 +44,8 @@ public function testMissingHost()
$this->load(
array(
'sitemap_provider' => array(
'host' => null
)
'host' => null,
),
)
);
$this->compile();
Expand Down
2 changes: 1 addition & 1 deletion Tests/Http/ClientTest.php
Expand Up @@ -50,7 +50,7 @@ public function responseProvider()
array(200, '<p>foo</p>'),
array(404, '<p>foo</p>'),
array(500, '<p>foo</p>'),
array(301, '')
array(301, ''),
);
}

Expand Down
4 changes: 2 additions & 2 deletions Tests/Http/Guzzle4ClientTest.php
Expand Up @@ -27,7 +27,7 @@ protected function createClientForFetch($status, $content)
$guzzle->getEmitter()->attach(
new Mock(
array(
new Response($status, array(), Stream::factory($content))
new Response($status, array(), Stream::factory($content)),
)
)
);
Expand All @@ -41,7 +41,7 @@ protected function createClientForFetchTimeout()
$guzzle->getEmitter()->attach(
new Mock(
array(
new RequestException('timeout...', $guzzle->createRequest('GET', self::EXAMPLE_URL))
new RequestException('timeout...', $guzzle->createRequest('GET', self::EXAMPLE_URL)),
)
)
);
Expand Down
22 changes: 11 additions & 11 deletions Tests/UrlProvider/SitemapUrlProviderTest.php
Expand Up @@ -39,44 +39,44 @@ public function fetchProvider()
array(
array(
new Response('/sitemap_index.xml', '', 404),
new Response('/sitemap.xml', '<?xml version="1.0" encoding="UTF-8"?><urlset><url><loc>http://foo.com</loc></url><url><loc>http://bar.com</loc></url></urlset>', 200)
new Response('/sitemap.xml', '<?xml version="1.0" encoding="UTF-8"?><urlset><url><loc>http://foo.com</loc></url><url><loc>http://bar.com</loc></url></urlset>', 200),
),
2,
array('http://foo.com', 'http://bar.com')
array('http://foo.com', 'http://bar.com'),
),
array(
array(
new Response('/sitemap_index.xml', '', 404),
new Response('/sitemap.xml', '<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"><url><loc>http://foo.com</loc></url><url><loc>http://bar.com</loc></url></urlset>', 200)
new Response('/sitemap.xml', '<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"><url><loc>http://foo.com</loc></url><url><loc>http://bar.com</loc></url></urlset>', 200),
),
2,
array('http://foo.com', 'http://bar.com')
array('http://foo.com', 'http://bar.com'),
),
array(
array(
new Response('/sitemap_index.xml', '<?xml version="1.0" encoding="UTF-8"?><sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><sitemap><loc>http://baz.com/sitemap.xml</loc></sitemap></sitemapindex>', 200),
new Response('http://baz.com/sitemap.xml', '<?xml version="1.0" encoding="UTF-8"?><urlset><url><loc>http://foo.com</loc></url><url><loc>http://bar.com</loc></url></urlset>', 200)
new Response('http://baz.com/sitemap.xml', '<?xml version="1.0" encoding="UTF-8"?><urlset><url><loc>http://foo.com</loc></url><url><loc>http://bar.com</loc></url></urlset>', 200),
),
2,
array('http://foo.com', 'http://bar.com')
array('http://foo.com', 'http://bar.com'),
),
array(
array(
new Response('/sitemap_index.xml', '<?xml version="1.0" encoding="UTF-8"?><sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><sitemap><loc>http://baz.com/sitemap1.xml</loc></sitemap><sitemap><loc>http://baz.com/sitemap2.xml</loc></sitemap></sitemapindex>', 200),
new Response('http://baz.com/sitemap1.xml', '<?xml version="1.0" encoding="UTF-8"?><urlset><url><loc>http://foo.com</loc></url><url><loc>http://bar.com</loc></url></urlset>', 200),
new Response('http://baz.com/sitemap2.xml', '<?xml version="1.0" encoding="UTF-8"?><urlset><url><loc>http://foo.com</loc></url><url><loc>http://bar.com</loc></url></urlset>', 200)
new Response('http://baz.com/sitemap2.xml', '<?xml version="1.0" encoding="UTF-8"?><urlset><url><loc>http://foo.com</loc></url><url><loc>http://bar.com</loc></url></urlset>', 200),
),
4,
array('http://foo.com', 'http://bar.com', 'http://foo.com', 'http://bar.com')
array('http://foo.com', 'http://bar.com', 'http://foo.com', 'http://bar.com'),
),
array(
array(
new Response('/sitemap_index.xml', '', 404),
new Response('/sitemap.xml', '', 404)
new Response('/sitemap.xml', '', 404),
),
0,
array()
)
array(),
),
);
}
}

0 comments on commit 0c92970

Please sign in to comment.