Skip to content

Commit

Permalink
Merge pull request #17 from naxel/master
Browse files Browse the repository at this point in the history
Renamed classes  Pinger -> SiteSearchPinger
  • Loading branch information
Anton authored and Anton committed Oct 31, 2013
2 parents 2010de4 + f5d3b71 commit ac90682
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
<?php
/**
* Example of usage Yandex\Pinger package
* Example of usage Yandex\SiteSearchPinger package
*
* @author Anton Shevchuk
* @created 07.08.13 10:32
*/

use Yandex\SiteSearchPinger\SiteSearchPinger;

$settings = require_once '../settings.php';

$pinger = new Yandex\Pinger\Pinger();
$pinger = new SiteSearchPinger();

$pinger->key = $settings["pinger"]["key"];
$pinger->login = $settings["pinger"]["login"];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* @namespace
*/
namespace Yandex\Pinger\Exception;
namespace Yandex\SiteSearchPinger\Exception;


/**
Expand All @@ -11,11 +11,11 @@
* Check settings on page {@link http://site.yandex.ru/searches/}
*
* @category Yandex
* @package Pinger
* @package SiteSearchPinger
*
* @author Anton Shevchuk
* @created 24.07.13 18:59
*/
class InvalidUrlException extends PingerException
class InvalidUrlException extends SiteSearchPingerException
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
/**
* @namespace
*/
namespace Yandex\Pinger\Exception;
namespace Yandex\SiteSearchPinger\Exception;

use Yandex\Common\Exception\Exception;

/**
* Pinger Exception
* SiteSearchPinger Exception
*
* @category Yandex
* @package Pinger
* @package SiteSearchPinger
*
* @author Anton Shevchuk
* @created 24.07.13 11:19
*/
class PingerException extends Exception
class SiteSearchPingerException extends Exception
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@
/**
* @namespace
*/
namespace Yandex\Pinger;
namespace Yandex\SiteSearchPinger;

use Yandex\Common\AbstractPackage;
use Yandex\Common\Exception\InvalidArgumentException;
use Yandex\Pinger\Exception\InvalidUrlException;
use Yandex\Pinger\Exception\PingerException;
use Yandex\SiteSearchPinger\Exception\InvalidUrlException;
use Yandex\SiteSearchPinger\Exception\SiteSearchPingerException;
use Guzzle\Http\Client;
use Guzzle\Http\Exception\ClientErrorResponseException;

/**
* Pinger
* SiteSearchPinger
*
* @category Yandex
* @package Pinger
* @package SiteSearchPinger
*
* @property string $key
* @property string $login
Expand All @@ -25,7 +25,7 @@
* @author Anton Shevchuk
* @created 06.08.13 17:30
*/
class Pinger extends AbstractPackage
class SiteSearchPinger extends AbstractPackage
{
/**
* @var string
Expand Down Expand Up @@ -145,7 +145,7 @@ public function getInvalidUrls()
* @param string|array $urls
* @param integer $publishDate seconds from now to publish urls
*
* @throws Exception\PingerException
* @throws Exception\SiteSearchPingerException
* @throws Exception\InvalidUrlException
* @throws \Yandex\Common\Exception\InvalidArgumentException
* @return boolean
Expand All @@ -172,7 +172,7 @@ public function ping($urls, $publishDate = 0)
}

if (!$xml = $response->xml()) {
throw new PingerException("Wrong server response format");
throw new SiteSearchPingerException("Wrong server response format");
} elseif ($xml->getName() == 'empty-param') {
// workaround for invalid request, with empty `urls`
throw new InvalidUrlException("URL param is required");
Expand Down

0 comments on commit ac90682

Please sign in to comment.