{"id":17312253,"url":"https://github.com/halaxa/linked","last_synced_at":"2025-03-27T01:14:50.310Z","repository":{"id":177260301,"uuid":"660143435","full_name":"halaxa/linked","owner":"halaxa","description":"Admissions coding task","archived":false,"fork":false,"pushed_at":"2023-06-29T18:58:37.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-01T06:27:44.195Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/halaxa.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","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":"2023-06-29T10:35:08.000Z","updated_at":"2023-06-29T11:44:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"f792223d-6e29-49d1-a3c1-a8d64deab89d","html_url":"https://github.com/halaxa/linked","commit_stats":null,"previous_names":["halaxa/linked"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halaxa%2Flinked","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halaxa%2Flinked/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halaxa%2Flinked/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halaxa%2Flinked/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/halaxa","download_url":"https://codeload.github.com/halaxa/linked/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245761301,"owners_count":20667895,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-10-15T12:42:52.271Z","updated_at":"2025-03-27T01:14:50.293Z","avatar_url":"https://github.com/halaxa.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"GPT generated readme from repository analysis and a slight nudge in the right direction 😁:\n\n# Listed\n\n\"Listed\" is a PHP library that provides an implementation of a doubly-linked list. The list is sorted and can work with string and integer items. The library is meant to be used with PHP 8.0 and newer.\n\n## Installation\n\nUse composer to add the library to your project:\n\n```bash\ncomposer require halaxa/listed\n```\n\nThe library requires PHP 8.0 or newer. See `composer.json` for more details on dependencies.\n\n## Usage\n\nThe library provides `SortedLinkedListInt` and `SortedLinkedListString` classes for working with integer and string values respectively. Both classes implement `Countable` and `IteratorAggregate` interfaces. You can use the `get`, `first`, `last`, `insert`, `count`, and `getIterator` methods to manipulate and traverse the list.\n\nHere is a simple example of using the `SortedLinkedListInt` class:\n\n```php\nuse Listed\\SortedLinkedListInt;\n\n$list = new SortedLinkedListInt();\n\n$list-\u003einsert(42);\n$list-\u003einsert(24);\n$list-\u003einsert(33);\n\necho $list-\u003efirst(); // Outputs: 24\necho $list-\u003eget(1); // Outputs: 33\necho $list-\u003elast(); // Outputs: 42\n```\n\n## Development\n\nThe library comes with a set of Composer scripts and a `Makefile` for development purposes. Here is a brief description of the available commands:\n\n- `composer tests` - Runs the test suite.\n- `composer cs-check` - Checks the code style.\n- `composer cs-fix` - Fixes the code style.\n\nWhen running these commands via `make`, they are wrapped in a Docker container to ensure consistency across different development environments.\n\nFor example, you can use the following command to run the test suite on all supported PHP versions:\n\n```bash\nmake tests-all\n```\n\nPlease note that all `make` commands are essentially Composer commands wrapped in a Docker container.\n\nThe `Makefile` also includes a `release` command for creating a new release. It handles versioning, updates the `CHANGELOG.md` file, and pushes the release to the repository.\n\nBefore committing your changes or creating a release, make sure to run the `build` command:\n\n```bash\nmake build\n```\n\nThis command runs all necessary checks and tests.\n\nFor more information about the available commands and their usage, please refer to the `Makefile` and `composer.json` files.\n\n## Planned Work\n\nLinked is a work in progress with the following improvements planned:\n\n- Implement an internal cursor for optimized insertions and semi-sequential reads.\n- Implement a switch between LAZY and EAGER sort modes.\n- Implement a custom compare function.\n\n### Missing methods\n- `shift(): int|string`: Removes the first element from the list and returns it.\n- `pop(): int|string`: Removes the last element from the list and returns it.\n- `insertMany(value[])`: Inserts multiple elements into the list at once.\n- `remove(index): bool`: Removes the element at the specified index.\n- `indexOf(value): int`: Finds the index of the specified value in the list.\n- `clear(): void`: Removes all elements from the list.\n- `clone(): self`: Creates a copy of the current list.\n- `toArray(): array`: Converts the list to an array.\n\nThese features are expected to enhance the functionality of the library and provide users with more options for working with sorted linked lists. More information on these features will be provided as they are implemented.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhalaxa%2Flinked","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhalaxa%2Flinked","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhalaxa%2Flinked/lists"}