Skip to content
This repository has been archived by the owner on Aug 13, 2023. It is now read-only.

Commit

Permalink
Move APIs into separate package
Browse files Browse the repository at this point in the history
Signed-off-by: Yoshi2889 <rick.2889@gmail.com>
  • Loading branch information
NanoSector committed Jan 4, 2016
1 parent 49b8a9d commit f83ddb6
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 249 deletions.
9 changes: 4 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@

{
"name": "wildphp/wild-irc-bot",
"version": "2.0.2",
"version": "2.0.3",
"description": "A modular IRC bot written in PHP",
"type": "project",
"require": {
"php": ">=5.5.0",
"myclabs/php-enum": "^1.4",
"react/react": "^0.4.2",
"guzzlehttp/guzzle": "^6.1",
"wildphp/module-channelmanager": "^2.1",
"wildphp/module-linksniffer": "^2.0"
"react/react": "^0.4",
"wildphp/api": "*"
},
"require-dev":
{
Expand Down
118 changes: 0 additions & 118 deletions lib/WildPHP/API/Remote.php

This file was deleted.

53 changes: 0 additions & 53 deletions lib/WildPHP/API/ShortenUri.php

This file was deleted.

27 changes: 0 additions & 27 deletions lib/WildPHP/Exceptions/InvalidUriException.php

This file was deleted.

27 changes: 0 additions & 27 deletions lib/WildPHP/Exceptions/ShortUriCreationFailedException.php

This file was deleted.

23 changes: 4 additions & 19 deletions lib/WildPHP/Validation.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,35 +19,20 @@
*/

namespace WildPHP;
use WildPHP\API\Validation as NewValidationClass;

/**
* Validation class, with shortcuts for validating items.
* Wrapper for new validation class.
*/
class Validation
{
/**
* Checks if a channel name conforms to RFC2812's grammar rules.
*
* @param string $chan The channel name to check.
* @return bool
*/
public static function isChannel($chan)
{
$pmatch = preg_match('/^(?:\&|\#|\+|\!)[^,\cG ]+$/', $chan);

return $pmatch !== 0 && $pmatch !== false;
return NewValidationClass::isChannel($chan);
}

/**
* Checks if a nickname conforms to RFC2812's grammar rules.
*
* @param string $nick The nickname to check.
* @return bool
*/
public static function isNickname($nick)
{
$pmatch = preg_match("/^[^@\n\r ]+$/", $nick);

return $pmatch !== 0 && $pmatch !== false;
return NewValidationClass::isNickname($nick);
}
}

0 comments on commit f83ddb6

Please sign in to comment.