{"id":15026074,"url":"https://github.com/gabfr/linian-number-analyzer","last_synced_at":"2026-02-15T14:39:32.961Z","repository":{"id":148010661,"uuid":"215087483","full_name":"gabfr/linian-number-analyzer","owner":"gabfr","description":"A simple code challenge with tricky requirements :) (more on readme)","archived":false,"fork":false,"pushed_at":"2019-10-15T19:15:38.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-11T11:50:07.920Z","etag":null,"topics":["php72","phpunit"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gabfr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-14T16:04:04.000Z","updated_at":"2019-10-15T19:15:39.000Z","dependencies_parsed_at":"2023-05-28T05:45:17.466Z","dependency_job_id":null,"html_url":"https://github.com/gabfr/linian-number-analyzer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gabfr/linian-number-analyzer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabfr%2Flinian-number-analyzer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabfr%2Flinian-number-analyzer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabfr%2Flinian-number-analyzer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabfr%2Flinian-number-analyzer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gabfr","download_url":"https://codeload.github.com/gabfr/linian-number-analyzer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabfr%2Flinian-number-analyzer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29481700,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-15T11:35:25.641Z","status":"ssl_error","status_checked_at":"2026-02-15T11:34:57.128Z","response_time":118,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["php72","phpunit"],"created_at":"2024-09-24T20:03:40.903Z","updated_at":"2026-02-15T14:39:32.943Z","avatar_url":"https://github.com/gabfr.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Linian Number Analyzer Code Challenge\n\nWe have to write a program that prints all the numbers from 1 to 100. However, for\nmultiples of 3, instead of the number, print \"Linio\". For multiples of 5 print\n\"IT\". For numbers which are multiples of both 3 and 5, print \"Linianos\".\n\nBut here's the catch: you can use only one `if`. No multiple branches, ternary\noperators or `else`.\n\n## Requirements\n\n - 1 if\n - You can't use `else`, `else if` or ternary\n - Unit tests\n - Feel free to apply your SOLID knowledge\n - You can write the challenge in any language you want. Here at Linio we are big fans of PHP, Kotlin and TypeScript\n\n# Solution\n\nThe solution purpose is to implement the described rules above with pre-defined analyzers. \n\nThis way we can concentrate each analysis in a self-contained class with a common contract with other analyzers.\n\nThis contract is made to receive an integer and return a simple string with the analysis result.\n\nIn case the analyzer is not the right one for the number, the Analyzer will return `null` and the AnalysisManager will try to run the next Analyzers until he finds one that returns the analysis result. For that reason we will have a Fallback analyzer called DecimalFallbackAnalyzer.\n\n## Getting started\n\nBefore running the analyzer, you will need to install the project dependencies with `composer install`.\n\n### Running the Analyzer\n\nBy default the analyzer will run in the range from 1 to 100, you can run it with this simple command:\n\n```\nbin/linian-number-analyzer\n```\n\nIf you receive the permission error, try adding execution permission for this binary file:\n\n```\nchmod +x bin/linian-number-analyzer\n```\n\n## Running the tests\n\nTo run the test cases within this project just execute:\n\n```\nvendor/bin/phpunit tests/AnalyzersTests.php\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgabfr%2Flinian-number-analyzer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgabfr%2Flinian-number-analyzer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgabfr%2Flinian-number-analyzer/lists"}