{"action":"created","issue":{"url":"https://api.github.com/repos/phospr/fraction/issues/20","repository_url":"https://api.github.com/repos/phospr/fraction","labels_url":"https://api.github.com/repos/phospr/fraction/issues/20/labels{/name}","comments_url":"https://api.github.com/repos/phospr/fraction/issues/20/comments","events_url":"https://api.github.com/repos/phospr/fraction/issues/20/events","html_url":"https://github.com/phospr/fraction/pull/20","id":196781673,"number":20,"title":"Add option to skip simplification","user":{"login":"jazzdan","id":452453,"avatar_url":"https://avatars.githubusercontent.com/u/452453?v=3","gravatar_id":"","url":"https://api.github.com/users/jazzdan","html_url":"https://github.com/jazzdan","followers_url":"https://api.github.com/users/jazzdan/followers","following_url":"https://api.github.com/users/jazzdan/following{/other_user}","gists_url":"https://api.github.com/users/jazzdan/gists{/gist_id}","starred_url":"https://api.github.com/users/jazzdan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jazzdan/subscriptions","organizations_url":"https://api.github.com/users/jazzdan/orgs","repos_url":"https://api.github.com/users/jazzdan/repos","events_url":"https://api.github.com/users/jazzdan/events{/privacy}","received_events_url":"https://api.github.com/users/jazzdan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-12-20T21:08:15Z","updated_at":"2016-12-20T22:16:20Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/phospr/fraction/pulls/20","html_url":"https://github.com/phospr/fraction/pull/20","diff_url":"https://github.com/phospr/fraction/pull/20.diff","patch_url":"https://github.com/phospr/fraction/pull/20.patch"},"body":"Summary\r\n-------\r\nThis diff adds a parameter to the constructor of the `Fraction` class\r\ncalled `$shouldSimplify`. When set to false it skips the last step of\r\ncalling the `simplify()` function.\r\n\r\nThe parameter is defaulted to `true` so there is no change in existing\r\nbehavior.\r\n\r\nTest Plan\r\n--------\r\nSee new unit test.\r\n\r\nQuestions\r\n---------\r\n- My other thought was making `simplify()` protected so that we could\r\n  subclass it and remove the simplification functionality in a subclass.\r\n\r\nContext\r\n-------\r\nWe want to be able to validate that a string is \"fraction-like\", but\r\nkeep the format that the string was originally in."},"comment":{"url":"https://api.github.com/repos/phospr/fraction/issues/comments/268375208","html_url":"https://github.com/phospr/fraction/pull/20#issuecomment-268375208","issue_url":"https://api.github.com/repos/phospr/fraction/issues/20","id":268375208,"user":{"login":"tomhv","id":301805,"avatar_url":"https://avatars.githubusercontent.com/u/301805?v=3","gravatar_id":"","url":"https://api.github.com/users/tomhv","html_url":"https://github.com/tomhv","followers_url":"https://api.github.com/users/tomhv/followers","following_url":"https://api.github.com/users/tomhv/following{/other_user}","gists_url":"https://api.github.com/users/tomhv/gists{/gist_id}","starred_url":"https://api.github.com/users/tomhv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomhv/subscriptions","organizations_url":"https://api.github.com/users/tomhv/orgs","repos_url":"https://api.github.com/users/tomhv/repos","events_url":"https://api.github.com/users/tomhv/events{/privacy}","received_events_url":"https://api.github.com/users/tomhv/received_events","type":"User","site_admin":false},"created_at":"2016-12-20T22:16:20Z","updated_at":"2016-12-20T22:16:20Z","body":"I had originally envisaged `Fraction` as a value object. So **1/2** would equate to **2/4**. And **2/4** + **1/2** would equate to **1**.  I think what we're trying to do is to give the value object \"a memory\".  We want to remember that **1 1/2** was created from **6/4**.  At first glance that works fine. We could simplify the fraction before comparing or operating upon. But we're still left with the following:\r\n\r\n```php\r\n// given\r\n$one = Fraction::fromSting('1/2');\r\n$two = Fraction::fromSting('2/4');\r\n\r\n// current functionality\r\n$one->isSameValueAs($one); // true\r\n(string) $one == (string) $two; // true\r\n\r\n// proposed functionality\r\n$one->isSameValueAs($one); // true\r\n(string) $one == (string) $two; // false\r\n```\r\n\r\nI'm trying hard to get my head around this, but it still seems wrong.  I'm open to ways to rationalize this."}}
{"actor":{"display_login":"tomhv"}}