{"action":"created","comment":{"url":"https://api.github.com/repos/SqueezyWeb/Database/pulls/comments/52308908","id":52308908,"diff_hunk":"@@ -0,0 +1,662 @@\n+<?php\n+/**\n+ * Field class file.\n+ *\n+ * @package Freyja\\Database\\Schema\n+ * @copyright 2016 SqueezyWeb\n+ * @since 0.1.0\n+ */\n+\n+namespace Freyja\\Database\\Schema;\n+\n+use Freyja\\Exceptions\\InvalidArgumentException as InvArgExcp;\n+use RuntimeException;\n+use LogicException;\n+\n+/**\n+ * Field class.\n+ *\n+ * @package Freyja\\Database\\Schema\n+ * @author Gianluca Merlo <gianluca@squeezyweb.com>\n+ * @since 0.1.0\n+ * @version 1.0.0\n+ */\n+class Field {\n+  /**\n+   * Field name.\n+   *\n+   * @since 1.0.0\n+   * @access private\n+   * @var string\n+   */\n+  private $name;\n+\n+  /**\n+   * Data type.\n+   *\n+   * @since 1.0.0\n+   * @access private\n+   * @var string\n+   */\n+  private $type;\n+\n+  /**\n+   * Data length.\n+   *\n+   * @since 1.0.0\n+   * @access private\n+   * @var int\n+   */\n+  private $length;\n+\n+  /**\n+   * Number of decimals.\n+   *\n+   * @since 1.0.0\n+   * @access private\n+   * @var int\n+   */\n+  private $decimals;\n+\n+  /**\n+   * Default value.\n+   *\n+   * @since 1.0.0\n+   * @access private\n+   * @var mixed\n+   */\n+  private $default;\n+\n+  /**\n+   * Nullable field.\n+   *\n+   * Whether the field is nullable or not. Default true;\n+   *\n+   * @since 1.0.0\n+   * @access private\n+   * @var boolean\n+   */\n+  private $nullable = true;\n+\n+  /**\n+   * Unsigned data.\n+   *\n+   * Whether the field is UNSIGNED or not. Only for numeric data types.\n+   * Default false.\n+   *\n+   * @since 1.0.0\n+   * @access private\n+   * @var boolean\n+   */\n+  private $unsigned = false;\n+\n+  /**\n+   * Auto increment.\n+   *\n+   * Whether the field is AUTO_INCREMENT or not. Default false.\n+   *\n+   * @since 1.0.0\n+   * @access private\n+   * @var boolean\n+   */\n+  private $auto_increment = false;\n+\n+  /**\n+   * Types that can be UNSIGNED and AUTO_INCREMENT.\n+   *\n+   * @since 1.0.0\n+   * @access private\n+   * @var array\n+   */\n+  private $allowed = array(\n+    self::INT,\n+    self::TINY_INT,\n+    self::SMALL_INT,\n+    self::MEDIUM_INT,\n+    self::BIG_INT,\n+    self::FLOAT,\n+    self::DOUBLE,\n+    self::DECIMAL\n+  );\n+\n+  /**\n+   * Data type constants.\n+   *\n+   * @since 1.0.0\n+   * @access public\n+   * @var string\n+   */\n+  // Numeric types.\n+  const INT = 'INT';\n+  const TINY_INT = 'TINYINT';\n+  const SMALL_INT = 'SMALLINT';\n+  const MEDIUM_INT = 'MEDIUMINT';\n+  const BIG_INT = 'BIGINT';\n+  const FLOAT = 'FLOAT';\n+  const DOUBLE = 'DOUBLE';\n+  const DECIMAL = 'DECIMAL';\n+  // Date and time types.\n+  const DATE = 'DATE';\n+  const DATETIME = 'DATETIME';\n+  const TIMESTAMP = 'TIMESTAMP';\n+  const TIME = 'TIME';\n+  // String types.\n+  const CHAR = 'CHAR';\n+  const VARCHAR = 'VARCHAR';\n+  const TEXT = 'TEXT';\n+  const TINY_TEXT = 'TINYTEXT';\n+  const MEDIUM_TEXT = 'MEDIUMTEXT';\n+  const LONG_TEXT = 'LONGTEXT';\n+\n+  /**\n+   * Null value constant.\n+   *\n+   * @since 1.0.0\n+   * @access public\n+   * @var string\n+   */\n+  const NULL = 'NULL';\n+\n+  /**\n+   * Class constructor.\n+   *\n+   * @since 1.0.0\n+   * @access public\n+   *\n+   * @param string $name Field name.\n+   *\n+   * @throws Freyja\\Exceptions\\InvalidArgumentException if $name isn't a string.\n+   */\n+  public function __construct($name) {\n+    if (!is_string($name))\n+      throw InvArgExcp::typeMismatch('field name', $name, 'String');","path":"Lib/Schema/Field.php","position":172,"original_position":172,"commit_id":"562db1d59e593a375ec5da7f688634d9a781363f","original_commit_id":"562db1d59e593a375ec5da7f688634d9a781363f","user":{"login":"wraxen","id":6460339,"avatar_url":"https://avatars.githubusercontent.com/u/6460339?v=3","gravatar_id":"","url":"https://api.github.com/users/wraxen","html_url":"https://github.com/wraxen","followers_url":"https://api.github.com/users/wraxen/followers","following_url":"https://api.github.com/users/wraxen/following{/other_user}","gists_url":"https://api.github.com/users/wraxen/gists{/gist_id}","starred_url":"https://api.github.com/users/wraxen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wraxen/subscriptions","organizations_url":"https://api.github.com/users/wraxen/orgs","repos_url":"https://api.github.com/users/wraxen/repos","events_url":"https://api.github.com/users/wraxen/events{/privacy}","received_events_url":"https://api.github.com/users/wraxen/received_events","type":"User","site_admin":false},"body":"I thing i don't get your point here.","created_at":"2016-02-09T13:50:00Z","updated_at":"2016-02-09T13:50:00Z","html_url":"https://github.com/SqueezyWeb/Database/pull/11#discussion_r52308908","pull_request_url":"https://api.github.com/repos/SqueezyWeb/Database/pulls/11","_links":{"self":{"href":"https://api.github.com/repos/SqueezyWeb/Database/pulls/comments/52308908"},"html":{"href":"https://github.com/SqueezyWeb/Database/pull/11#discussion_r52308908"},"pull_request":{"href":"https://api.github.com/repos/SqueezyWeb/Database/pulls/11"}}},"pull_request":{"url":"https://api.github.com/repos/SqueezyWeb/Database/pulls/11","id":58617038,"html_url":"https://github.com/SqueezyWeb/Database/pull/11","diff_url":"https://github.com/SqueezyWeb/Database/pull/11.diff","patch_url":"https://github.com/SqueezyWeb/Database/pull/11.patch","issue_url":"https://api.github.com/repos/SqueezyWeb/Database/issues/11","number":11,"state":"open","locked":false,"title":"Create Schema classes","user":{"login":"wraxen","id":6460339,"avatar_url":"https://avatars.githubusercontent.com/u/6460339?v=3","gravatar_id":"","url":"https://api.github.com/users/wraxen","html_url":"https://github.com/wraxen","followers_url":"https://api.github.com/users/wraxen/followers","following_url":"https://api.github.com/users/wraxen/following{/other_user}","gists_url":"https://api.github.com/users/wraxen/gists{/gist_id}","starred_url":"https://api.github.com/users/wraxen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wraxen/subscriptions","organizations_url":"https://api.github.com/users/wraxen/orgs","repos_url":"https://api.github.com/users/wraxen/repos","events_url":"https://api.github.com/users/wraxen/events{/privacy}","received_events_url":"https://api.github.com/users/wraxen/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-02-08T14:39:13Z","updated_at":"2016-02-09T13:50:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cd51b5d0cc72f02bbb5fe5313799d58e066b9c41","assignee":{"login":"wraxen","id":6460339,"avatar_url":"https://avatars.githubusercontent.com/u/6460339?v=3","gravatar_id":"","url":"https://api.github.com/users/wraxen","html_url":"https://github.com/wraxen","followers_url":"https://api.github.com/users/wraxen/followers","following_url":"https://api.github.com/users/wraxen/following{/other_user}","gists_url":"https://api.github.com/users/wraxen/gists{/gist_id}","starred_url":"https://api.github.com/users/wraxen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wraxen/subscriptions","organizations_url":"https://api.github.com/users/wraxen/orgs","repos_url":"https://api.github.com/users/wraxen/repos","events_url":"https://api.github.com/users/wraxen/events{/privacy}","received_events_url":"https://api.github.com/users/wraxen/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/SqueezyWeb/Database/milestones/1","html_url":"https://github.com/SqueezyWeb/Database/milestones/v0.1.0","labels_url":"https://api.github.com/repos/SqueezyWeb/Database/milestones/1/labels","id":1560715,"number":1,"title":"v0.1.0","description":null,"creator":{"login":"wraxen","id":6460339,"avatar_url":"https://avatars.githubusercontent.com/u/6460339?v=3","gravatar_id":"","url":"https://api.github.com/users/wraxen","html_url":"https://github.com/wraxen","followers_url":"https://api.github.com/users/wraxen/followers","following_url":"https://api.github.com/users/wraxen/following{/other_user}","gists_url":"https://api.github.com/users/wraxen/gists{/gist_id}","starred_url":"https://api.github.com/users/wraxen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wraxen/subscriptions","organizations_url":"https://api.github.com/users/wraxen/orgs","repos_url":"https://api.github.com/users/wraxen/repos","events_url":"https://api.github.com/users/wraxen/events{/privacy}","received_events_url":"https://api.github.com/users/wraxen/received_events","type":"User","site_admin":false},"open_issues":7,"closed_issues":4,"state":"open","created_at":"2016-02-03T10:05:52Z","updated_at":"2016-02-09T10:24:23Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/SqueezyWeb/Database/pulls/11/commits","review_comments_url":"https://api.github.com/repos/SqueezyWeb/Database/pulls/11/comments","review_comment_url":"https://api.github.com/repos/SqueezyWeb/Database/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SqueezyWeb/Database/issues/11/comments","statuses_url":"https://api.github.com/repos/SqueezyWeb/Database/statuses/562db1d59e593a375ec5da7f688634d9a781363f","head":{"label":"SqueezyWeb:feature/schema","ref":"feature/schema","sha":"562db1d59e593a375ec5da7f688634d9a781363f","user":{"login":"SqueezyWeb","id":17001957,"avatar_url":"https://avatars.githubusercontent.com/u/17001957?v=3","gravatar_id":"","url":"https://api.github.com/users/SqueezyWeb","html_url":"https://github.com/SqueezyWeb","followers_url":"https://api.github.com/users/SqueezyWeb/followers","following_url":"https://api.github.com/users/SqueezyWeb/following{/other_user}","gists_url":"https://api.github.com/users/SqueezyWeb/gists{/gist_id}","starred_url":"https://api.github.com/users/SqueezyWeb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SqueezyWeb/subscriptions","organizations_url":"https://api.github.com/users/SqueezyWeb/orgs","repos_url":"https://api.github.com/users/SqueezyWeb/repos","events_url":"https://api.github.com/users/SqueezyWeb/events{/privacy}","received_events_url":"https://api.github.com/users/SqueezyWeb/received_events","type":"Organization","site_admin":false},"repo":{"id":50827474,"name":"Database","full_name":"SqueezyWeb/Database","owner":{"login":"SqueezyWeb","id":17001957,"avatar_url":"https://avatars.githubusercontent.com/u/17001957?v=3","gravatar_id":"","url":"https://api.github.com/users/SqueezyWeb","html_url":"https://github.com/SqueezyWeb","followers_url":"https://api.github.com/users/SqueezyWeb/followers","following_url":"https://api.github.com/users/SqueezyWeb/following{/other_user}","gists_url":"https://api.github.com/users/SqueezyWeb/gists{/gist_id}","starred_url":"https://api.github.com/users/SqueezyWeb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SqueezyWeb/subscriptions","organizations_url":"https://api.github.com/users/SqueezyWeb/orgs","repos_url":"https://api.github.com/users/SqueezyWeb/repos","events_url":"https://api.github.com/users/SqueezyWeb/events{/privacy}","received_events_url":"https://api.github.com/users/SqueezyWeb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SqueezyWeb/Database","description":"Simple database manager","fork":false,"url":"https://api.github.com/repos/SqueezyWeb/Database","forks_url":"https://api.github.com/repos/SqueezyWeb/Database/forks","keys_url":"https://api.github.com/repos/SqueezyWeb/Database/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SqueezyWeb/Database/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SqueezyWeb/Database/teams","hooks_url":"https://api.github.com/repos/SqueezyWeb/Database/hooks","issue_events_url":"https://api.github.com/repos/SqueezyWeb/Database/issues/events{/number}","events_url":"https://api.github.com/repos/SqueezyWeb/Database/events","assignees_url":"https://api.github.com/repos/SqueezyWeb/Database/assignees{/user}","branches_url":"https://api.github.com/repos/SqueezyWeb/Database/branches{/branch}","tags_url":"https://api.github.com/repos/SqueezyWeb/Database/tags","blobs_url":"https://api.github.com/repos/SqueezyWeb/Database/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SqueezyWeb/Database/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SqueezyWeb/Database/git/refs{/sha}","trees_url":"https://api.github.com/repos/SqueezyWeb/Database/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SqueezyWeb/Database/statuses/{sha}","languages_url":"https://api.github.com/repos/SqueezyWeb/Database/languages","stargazers_url":"https://api.github.com/repos/SqueezyWeb/Database/stargazers","contributors_url":"https://api.github.com/repos/SqueezyWeb/Database/contributors","subscribers_url":"https://api.github.com/repos/SqueezyWeb/Database/subscribers","subscription_url":"https://api.github.com/repos/SqueezyWeb/Database/subscription","commits_url":"https://api.github.com/repos/SqueezyWeb/Database/commits{/sha}","git_commits_url":"https://api.github.com/repos/SqueezyWeb/Database/git/commits{/sha}","comments_url":"https://api.github.com/repos/SqueezyWeb/Database/comments{/number}","issue_comment_url":"https://api.github.com/repos/SqueezyWeb/Database/issues/comments{/number}","contents_url":"https://api.github.com/repos/SqueezyWeb/Database/contents/{+path}","compare_url":"https://api.github.com/repos/SqueezyWeb/Database/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SqueezyWeb/Database/merges","archive_url":"https://api.github.com/repos/SqueezyWeb/Database/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SqueezyWeb/Database/downloads","issues_url":"https://api.github.com/repos/SqueezyWeb/Database/issues{/number}","pulls_url":"https://api.github.com/repos/SqueezyWeb/Database/pulls{/number}","milestones_url":"https://api.github.com/repos/SqueezyWeb/Database/milestones{/number}","notifications_url":"https://api.github.com/repos/SqueezyWeb/Database/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SqueezyWeb/Database/labels{/name}","releases_url":"https://api.github.com/repos/SqueezyWeb/Database/releases{/id}","deployments_url":"https://api.github.com/repos/SqueezyWeb/Database/deployments","created_at":"2016-02-01T09:03:37Z","updated_at":"2016-02-01T09:39:25Z","pushed_at":"2016-02-09T11:36:57Z","git_url":"git://github.com/SqueezyWeb/Database.git","ssh_url":"git@github.com:SqueezyWeb/Database.git","clone_url":"https://github.com/SqueezyWeb/Database.git","svn_url":"https://github.com/SqueezyWeb/Database","homepage":null,"size":57,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":8,"forks":0,"open_issues":8,"watchers":0,"default_branch":"master"}},"base":{"label":"SqueezyWeb:master","ref":"master","sha":"1038c9101953f2e77b439a3495f4e155fb3f7703","user":{"login":"SqueezyWeb","id":17001957,"avatar_url":"https://avatars.githubusercontent.com/u/17001957?v=3","gravatar_id":"","url":"https://api.github.com/users/SqueezyWeb","html_url":"https://github.com/SqueezyWeb","followers_url":"https://api.github.com/users/SqueezyWeb/followers","following_url":"https://api.github.com/users/SqueezyWeb/following{/other_user}","gists_url":"https://api.github.com/users/SqueezyWeb/gists{/gist_id}","starred_url":"https://api.github.com/users/SqueezyWeb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SqueezyWeb/subscriptions","organizations_url":"https://api.github.com/users/SqueezyWeb/orgs","repos_url":"https://api.github.com/users/SqueezyWeb/repos","events_url":"https://api.github.com/users/SqueezyWeb/events{/privacy}","received_events_url":"https://api.github.com/users/SqueezyWeb/received_events","type":"Organization","site_admin":false},"repo":{"id":50827474,"name":"Database","full_name":"SqueezyWeb/Database","owner":{"login":"SqueezyWeb","id":17001957,"avatar_url":"https://avatars.githubusercontent.com/u/17001957?v=3","gravatar_id":"","url":"https://api.github.com/users/SqueezyWeb","html_url":"https://github.com/SqueezyWeb","followers_url":"https://api.github.com/users/SqueezyWeb/followers","following_url":"https://api.github.com/users/SqueezyWeb/following{/other_user}","gists_url":"https://api.github.com/users/SqueezyWeb/gists{/gist_id}","starred_url":"https://api.github.com/users/SqueezyWeb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SqueezyWeb/subscriptions","organizations_url":"https://api.github.com/users/SqueezyWeb/orgs","repos_url":"https://api.github.com/users/SqueezyWeb/repos","events_url":"https://api.github.com/users/SqueezyWeb/events{/privacy}","received_events_url":"https://api.github.com/users/SqueezyWeb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SqueezyWeb/Database","description":"Simple database manager","fork":false,"url":"https://api.github.com/repos/SqueezyWeb/Database","forks_url":"https://api.github.com/repos/SqueezyWeb/Database/forks","keys_url":"https://api.github.com/repos/SqueezyWeb/Database/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SqueezyWeb/Database/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SqueezyWeb/Database/teams","hooks_url":"https://api.github.com/repos/SqueezyWeb/Database/hooks","issue_events_url":"https://api.github.com/repos/SqueezyWeb/Database/issues/events{/number}","events_url":"https://api.github.com/repos/SqueezyWeb/Database/events","assignees_url":"https://api.github.com/repos/SqueezyWeb/Database/assignees{/user}","branches_url":"https://api.github.com/repos/SqueezyWeb/Database/branches{/branch}","tags_url":"https://api.github.com/repos/SqueezyWeb/Database/tags","blobs_url":"https://api.github.com/repos/SqueezyWeb/Database/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SqueezyWeb/Database/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SqueezyWeb/Database/git/refs{/sha}","trees_url":"https://api.github.com/repos/SqueezyWeb/Database/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SqueezyWeb/Database/statuses/{sha}","languages_url":"https://api.github.com/repos/SqueezyWeb/Database/languages","stargazers_url":"https://api.github.com/repos/SqueezyWeb/Database/stargazers","contributors_url":"https://api.github.com/repos/SqueezyWeb/Database/contributors","subscribers_url":"https://api.github.com/repos/SqueezyWeb/Database/subscribers","subscription_url":"https://api.github.com/repos/SqueezyWeb/Database/subscription","commits_url":"https://api.github.com/repos/SqueezyWeb/Database/commits{/sha}","git_commits_url":"https://api.github.com/repos/SqueezyWeb/Database/git/commits{/sha}","comments_url":"https://api.github.com/repos/SqueezyWeb/Database/comments{/number}","issue_comment_url":"https://api.github.com/repos/SqueezyWeb/Database/issues/comments{/number}","contents_url":"https://api.github.com/repos/SqueezyWeb/Database/contents/{+path}","compare_url":"https://api.github.com/repos/SqueezyWeb/Database/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SqueezyWeb/Database/merges","archive_url":"https://api.github.com/repos/SqueezyWeb/Database/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SqueezyWeb/Database/downloads","issues_url":"https://api.github.com/repos/SqueezyWeb/Database/issues{/number}","pulls_url":"https://api.github.com/repos/SqueezyWeb/Database/pulls{/number}","milestones_url":"https://api.github.com/repos/SqueezyWeb/Database/milestones{/number}","notifications_url":"https://api.github.com/repos/SqueezyWeb/Database/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SqueezyWeb/Database/labels{/name}","releases_url":"https://api.github.com/repos/SqueezyWeb/Database/releases{/id}","deployments_url":"https://api.github.com/repos/SqueezyWeb/Database/deployments","created_at":"2016-02-01T09:03:37Z","updated_at":"2016-02-01T09:39:25Z","pushed_at":"2016-02-09T11:36:57Z","git_url":"git://github.com/SqueezyWeb/Database.git","ssh_url":"git@github.com:SqueezyWeb/Database.git","clone_url":"https://github.com/SqueezyWeb/Database.git","svn_url":"https://github.com/SqueezyWeb/Database","homepage":null,"size":57,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":8,"forks":0,"open_issues":8,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SqueezyWeb/Database/pulls/11"},"html":{"href":"https://github.com/SqueezyWeb/Database/pull/11"},"issue":{"href":"https://api.github.com/repos/SqueezyWeb/Database/issues/11"},"comments":{"href":"https://api.github.com/repos/SqueezyWeb/Database/issues/11/comments"},"review_comments":{"href":"https://api.github.com/repos/SqueezyWeb/Database/pulls/11/comments"},"review_comment":{"href":"https://api.github.com/repos/SqueezyWeb/Database/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SqueezyWeb/Database/pulls/11/commits"},"statuses":{"href":"https://api.github.com/repos/SqueezyWeb/Database/statuses/562db1d59e593a375ec5da7f688634d9a781363f"}}}}