From 241edc9898e31b4d8f1abbfa990afac66c13f699 Mon Sep 17 00:00:00 2001 From: Jared Howland Date: Wed, 24 May 2023 10:06:02 -0600 Subject: [PATCH 1/2] Initial dev commit --- composer.json | 2 +- composer.lock | 501 ++++++------------ examples/AuthorSearch.json | 1 + src/Scopus/Parser.php | 52 ++ src/Scopus/Parsers/AbstractRetrieval.php | 33 ++ src/Scopus/Parsers/AffiliationRetrieval.php | 55 ++ src/Scopus/Parsers/AffiliationSearch.php | 34 ++ src/Scopus/Parsers/AuthorRetrieval.php | 59 +++ src/Scopus/Parsers/AuthorSearch.php | 71 +++ src/Scopus/Parsers/CitationsCount.php | 33 ++ src/Scopus/Parsers/CitationsOverview.php | 51 ++ src/Scopus/Parsers/ScopusSearch.php | 34 ++ src/Scopus/Parsers/SerialTitle.php | 80 +++ src/Scopus/Parsers/SubjectClassifications.php | 93 ++++ src/Scopus/Search/AbstractRetrieval.php | 66 +++ src/Scopus/Search/AffiliationRetrieval.php | 55 ++ src/Scopus/Search/AffiliationSearch.php | 34 ++ src/Scopus/Search/AuthorRetrieval.php | 59 +++ src/Scopus/Search/AuthorSearch.php | 43 ++ src/Scopus/Search/CitationsCount.php | 33 ++ src/Scopus/Search/CitationsOverview.php | 51 ++ src/Scopus/Search/ScopusSearch.php | 34 ++ src/Scopus/Search/SerialTitle.php | 80 +++ src/Scopus/Search/SubjectClassifications.php | 93 ++++ 24 files changed, 1304 insertions(+), 343 deletions(-) create mode 100644 examples/AuthorSearch.json create mode 100644 src/Scopus/Parser.php create mode 100644 src/Scopus/Parsers/AbstractRetrieval.php create mode 100644 src/Scopus/Parsers/AffiliationRetrieval.php create mode 100644 src/Scopus/Parsers/AffiliationSearch.php create mode 100644 src/Scopus/Parsers/AuthorRetrieval.php create mode 100644 src/Scopus/Parsers/AuthorSearch.php create mode 100644 src/Scopus/Parsers/CitationsCount.php create mode 100644 src/Scopus/Parsers/CitationsOverview.php create mode 100644 src/Scopus/Parsers/ScopusSearch.php create mode 100644 src/Scopus/Parsers/SerialTitle.php create mode 100644 src/Scopus/Parsers/SubjectClassifications.php create mode 100644 src/Scopus/Search/AbstractRetrieval.php create mode 100644 src/Scopus/Search/AffiliationRetrieval.php create mode 100644 src/Scopus/Search/AffiliationSearch.php create mode 100644 src/Scopus/Search/AuthorRetrieval.php create mode 100644 src/Scopus/Search/AuthorSearch.php create mode 100644 src/Scopus/Search/CitationsCount.php create mode 100644 src/Scopus/Search/CitationsOverview.php create mode 100644 src/Scopus/Search/ScopusSearch.php create mode 100644 src/Scopus/Search/SerialTitle.php create mode 100644 src/Scopus/Search/SubjectClassifications.php diff --git a/composer.json b/composer.json index 42c23ab..22a6917 100644 --- a/composer.json +++ b/composer.json @@ -17,6 +17,6 @@ ], "require": { "php": ">=7.0", - "guzzlehttp/guzzle": "^6.0" + "guzzlehttp/guzzle": "^7.0" } } diff --git a/composer.lock b/composer.lock index 05f9c5c..ad7b49c 100644 --- a/composer.lock +++ b/composer.lock @@ -4,41 +4,51 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "ab408fec36c671ae346346bb36316d02", + "content-hash": "2f72b2d429c777dc6aa3a55572e25caa", "packages": [ { "name": "guzzlehttp/guzzle", - "version": "6.5.8", + "version": "7.7.0", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "a52f0440530b54fa079ce76e8c5d196a42cad981" + "reference": "fb7566caccf22d74d1ab270de3551f72a58399f5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/a52f0440530b54fa079ce76e8c5d196a42cad981", - "reference": "a52f0440530b54fa079ce76e8c5d196a42cad981", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/fb7566caccf22d74d1ab270de3551f72a58399f5", + "reference": "fb7566caccf22d74d1ab270de3551f72a58399f5", "shasum": "" }, "require": { "ext-json": "*", - "guzzlehttp/promises": "^1.0", - "guzzlehttp/psr7": "^1.9", - "php": ">=5.5", - "symfony/polyfill-intl-idn": "^1.17" + "guzzlehttp/promises": "^1.5.3 || ^2.0", + "guzzlehttp/psr7": "^1.9.1 || ^2.4.5", + "php": "^7.2.5 || ^8.0", + "psr/http-client": "^1.0", + "symfony/deprecation-contracts": "^2.2 || ^3.0" + }, + "provide": { + "psr/http-client-implementation": "1.0" }, "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.1", "ext-curl": "*", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", - "psr/log": "^1.1" + "php-http/client-integration-tests": "dev-master#2c025848417c1135031fdf9c728ee53d0a7ceaee as 3.0.999", + "php-http/message-factory": "^1.1", + "phpunit/phpunit": "^8.5.29 || ^9.5.23", + "psr/log": "^1.1 || ^2.0 || ^3.0" }, "suggest": { + "ext-curl": "Required for CURL handler support", + "ext-intl": "Required for Internationalized Domain Name (IDN) support", "psr/log": "Required for using the Log middleware" }, "type": "library", "extra": { - "branch-alias": { - "dev-master": "6.5-dev" + "bamarni-bin": { + "bin-links": true, + "forward-command": false } }, "autoload": { @@ -91,19 +101,20 @@ } ], "description": "Guzzle is a PHP HTTP client library", - "homepage": "http://guzzlephp.org/", "keywords": [ "client", "curl", "framework", "http", "http client", + "psr-18", + "psr-7", "rest", "web service" ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/6.5.8" + "source": "https://github.com/guzzle/guzzle/tree/7.7.0" }, "funding": [ { @@ -119,38 +130,37 @@ "type": "tidelift" } ], - "time": "2022-06-20T22:16:07+00:00" + "time": "2023-05-21T14:04:53+00:00" }, { "name": "guzzlehttp/promises", - "version": "1.5.1", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da" + "reference": "3a494dc7dc1d7d12e511890177ae2d0e6c107da6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/fe752aedc9fd8fcca3fe7ad05d419d32998a06da", - "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da", + "url": "https://api.github.com/repos/guzzle/promises/zipball/3a494dc7dc1d7d12e511890177ae2d0e6c107da6", + "reference": "3a494dc7dc1d7d12e511890177ae2d0e6c107da6", "shasum": "" }, "require": { - "php": ">=5.5" + "php": "^7.2.5 || ^8.0" }, "require-dev": { - "symfony/phpunit-bridge": "^4.4 || ^5.1" + "bamarni/composer-bin-plugin": "^1.8.1", + "phpunit/phpunit": "^8.5.29 || ^9.5.23" }, "type": "library", "extra": { - "branch-alias": { - "dev-master": "1.5-dev" + "bamarni-bin": { + "bin-links": true, + "forward-command": false } }, "autoload": { - "files": [ - "src/functions_include.php" - ], "psr-4": { "GuzzleHttp\\Promise\\": "src/" } @@ -187,7 +197,7 @@ ], "support": { "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/1.5.1" + "source": "https://github.com/guzzle/promises/tree/2.0.0" }, "funding": [ { @@ -203,42 +213,48 @@ "type": "tidelift" } ], - "time": "2021-10-22T20:56:57+00:00" + "time": "2023-05-21T13:50:22+00:00" }, { "name": "guzzlehttp/psr7", - "version": "1.9.1", + "version": "2.5.0", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "e4490cabc77465aaee90b20cfc9a770f8c04be6b" + "reference": "b635f279edd83fc275f822a1188157ffea568ff6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/e4490cabc77465aaee90b20cfc9a770f8c04be6b", - "reference": "e4490cabc77465aaee90b20cfc9a770f8c04be6b", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/b635f279edd83fc275f822a1188157ffea568ff6", + "reference": "b635f279edd83fc275f822a1188157ffea568ff6", "shasum": "" }, "require": { - "php": ">=5.4.0", - "psr/http-message": "~1.0", - "ralouphie/getallheaders": "^2.0.5 || ^3.0.0" + "php": "^7.2.5 || ^8.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.1 || ^2.0", + "ralouphie/getallheaders": "^3.0" }, "provide": { + "psr/http-factory-implementation": "1.0", "psr/http-message-implementation": "1.0" }, "require-dev": { - "ext-zlib": "*", - "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.10" + "bamarni/composer-bin-plugin": "^1.8.1", + "http-interop/http-factory-tests": "^0.9", + "phpunit/phpunit": "^8.5.29 || ^9.5.23" }, "suggest": { "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" }, "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, "autoload": { - "files": [ - "src/functions_include.php" - ], "psr-4": { "GuzzleHttp\\Psr7\\": "src/" } @@ -277,6 +293,11 @@ "name": "Tobias Schultze", "email": "webmaster@tubo-world.de", "homepage": "https://github.com/Tobion" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://sagikazarmark.hu" } ], "description": "PSR-7 message implementation that also provides common utility methods", @@ -292,7 +313,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/1.9.1" + "source": "https://github.com/guzzle/psr7/tree/2.5.0" }, "funding": [ { @@ -308,74 +329,25 @@ "type": "tidelift" } ], - "time": "2023-04-17T16:00:37+00:00" + "time": "2023-04-17T16:11:26+00:00" }, { - "name": "paragonie/random_compat", - "version": "v9.99.100", + "name": "psr/http-client", + "version": "1.0.2", "source": { "type": "git", - "url": "https://github.com/paragonie/random_compat.git", - "reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a" + "url": "https://github.com/php-fig/http-client.git", + "reference": "0955afe48220520692d2d09f7ab7e0f93ffd6a31" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paragonie/random_compat/zipball/996434e5492cb4c3edcb9168db6fbb1359ef965a", - "reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a", + "url": "https://api.github.com/repos/php-fig/http-client/zipball/0955afe48220520692d2d09f7ab7e0f93ffd6a31", + "reference": "0955afe48220520692d2d09f7ab7e0f93ffd6a31", "shasum": "" }, "require": { - "php": ">= 7" - }, - "require-dev": { - "phpunit/phpunit": "4.*|5.*", - "vimeo/psalm": "^1" - }, - "suggest": { - "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." - }, - "type": "library", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Paragon Initiative Enterprises", - "email": "security@paragonie.com", - "homepage": "https://paragonie.com" - } - ], - "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", - "keywords": [ - "csprng", - "polyfill", - "pseudorandom", - "random" - ], - "support": { - "email": "info@paragonie.com", - "issues": "https://github.com/paragonie/random_compat/issues", - "source": "https://github.com/paragonie/random_compat" - }, - "time": "2020-10-15T08:29:30+00:00" - }, - { - "name": "psr/http-message", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-message.git", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" + "php": "^7.0 || ^8.0", + "psr/http-message": "^1.0 || ^2.0" }, "type": "library", "extra": { @@ -385,7 +357,7 @@ }, "autoload": { "psr-4": { - "Psr\\Http\\Message\\": "src/" + "Psr\\Http\\Client\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -395,107 +367,49 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], - "description": "Common interface for HTTP messages", - "homepage": "https://github.com/php-fig/http-message", + "description": "Common interface for HTTP clients", + "homepage": "https://github.com/php-fig/http-client", "keywords": [ "http", - "http-message", + "http-client", "psr", - "psr-7", - "request", - "response" + "psr-18" ], "support": { - "source": "https://github.com/php-fig/http-message/tree/master" + "source": "https://github.com/php-fig/http-client/tree/1.0.2" }, - "time": "2016-08-06T14:39:51+00:00" + "time": "2023-04-10T20:12:12+00:00" }, { - "name": "ralouphie/getallheaders", - "version": "3.0.3", + "name": "psr/http-factory", + "version": "1.0.2", "source": { "type": "git", - "url": "https://github.com/ralouphie/getallheaders.git", - "reference": "120b605dfeb996808c31b6477290a714d356e822" + "url": "https://github.com/php-fig/http-factory.git", + "reference": "e616d01114759c4c489f93b099585439f795fe35" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", - "reference": "120b605dfeb996808c31b6477290a714d356e822", - "shasum": "" - }, - "require": { - "php": ">=5.6" - }, - "require-dev": { - "php-coveralls/php-coveralls": "^2.1", - "phpunit/phpunit": "^5 || ^6.5" - }, - "type": "library", - "autoload": { - "files": [ - "src/getallheaders.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ralph Khattar", - "email": "ralph.khattar@gmail.com" - } - ], - "description": "A polyfill for getallheaders.", - "support": { - "issues": "https://github.com/ralouphie/getallheaders/issues", - "source": "https://github.com/ralouphie/getallheaders/tree/develop" - }, - "time": "2019-03-08T08:55:37+00:00" - }, - { - "name": "symfony/polyfill-intl-idn", - "version": "v1.19.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-idn.git", - "reference": "4ad5115c0f5d5172a9fe8147675ec6de266d8826" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/4ad5115c0f5d5172a9fe8147675ec6de266d8826", - "reference": "4ad5115c0f5d5172a9fe8147675ec6de266d8826", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/e616d01114759c4c489f93b099585439f795fe35", + "reference": "e616d01114759c4c489f93b099585439f795fe35", "shasum": "" }, "require": { - "php": ">=5.3.3", - "symfony/polyfill-intl-normalizer": "^1.10", - "symfony/polyfill-php70": "^1.10", - "symfony/polyfill-php72": "^1.10" - }, - "suggest": { - "ext-intl": "For best performance" + "php": ">=7.0.0", + "psr/http-message": "^1.0 || ^2.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "1.19-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "dev-master": "1.0.x-dev" } }, "autoload": { - "files": [ - "bootstrap.php" - ], "psr-4": { - "Symfony\\Polyfill\\Intl\\Idn\\": "" + "Psr\\Http\\Message\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -504,87 +418,53 @@ ], "authors": [ { - "name": "Laurent Bassin", - "email": "laurent@bassin.info" - }, - { - "name": "Trevor Rowbotham", - "email": "trevor.rowbotham@pm.me" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" } ], - "description": "Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions", - "homepage": "https://symfony.com", + "description": "Common interfaces for PSR-7 HTTP message factories", "keywords": [ - "compatibility", - "idn", - "intl", - "polyfill", - "portable", - "shim" + "factory", + "http", + "message", + "psr", + "psr-17", + "psr-7", + "request", + "response" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.19.0" + "source": "https://github.com/php-fig/http-factory/tree/1.0.2" }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2020-10-21T09:57:48+00:00" + "time": "2023-04-10T20:10:41+00:00" }, { - "name": "symfony/polyfill-intl-normalizer", - "version": "v1.19.0", + "name": "psr/http-message", + "version": "2.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "8db0ae7936b42feb370840cf24de1a144fb0ef27" + "url": "https://github.com/php-fig/http-message.git", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8db0ae7936b42feb370840cf24de1a144fb0ef27", - "reference": "8db0ae7936b42feb370840cf24de1a144fb0ef27", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71", "shasum": "" }, "require": { - "php": ">=5.3.3" - }, - "suggest": { - "ext-intl": "For best performance" + "php": "^7.2 || ^8.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "1.19-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "dev-master": "2.0.x-dev" } }, "autoload": { - "files": [ - "bootstrap.php" - ], "psr-4": { - "Symfony\\Polyfill\\Intl\\Normalizer\\": "" - }, - "classmap": [ - "Resources/stubs" - ] + "Psr\\Http\\Message\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -592,80 +472,50 @@ ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" } ], - "description": "Symfony polyfill for intl's Normalizer class and related functions", - "homepage": "https://symfony.com", + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", "keywords": [ - "compatibility", - "intl", - "normalizer", - "polyfill", - "portable", - "shim" + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.19.0" + "source": "https://github.com/php-fig/http-message/tree/2.0" }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2020-10-23T09:01:57+00:00" + "time": "2023-04-04T09:54:51+00:00" }, { - "name": "symfony/polyfill-php70", - "version": "v1.19.0", + "name": "ralouphie/getallheaders", + "version": "3.0.3", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-php70.git", - "reference": "3fe414077251a81a1b15b1c709faf5c2fbae3d4e" + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "120b605dfeb996808c31b6477290a714d356e822" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/3fe414077251a81a1b15b1c709faf5c2fbae3d4e", - "reference": "3fe414077251a81a1b15b1c709faf5c2fbae3d4e", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", + "reference": "120b605dfeb996808c31b6477290a714d356e822", "shasum": "" }, "require": { - "paragonie/random_compat": "~1.0|~2.0|~9.99", - "php": ">=5.3.3" + "php": ">=5.6" }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.19-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } + "require-dev": { + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^5 || ^6.5" }, + "type": "library", "autoload": { "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php70\\": "" - }, - "classmap": [ - "Resources/stubs" + "src/getallheaders.php" ] }, "notification-url": "https://packagist.org/downloads/", @@ -674,75 +524,48 @@ ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" } ], - "description": "Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], + "description": "A polyfill for getallheaders.", "support": { - "source": "https://github.com/symfony/polyfill-php70/tree/v1.19.0" + "issues": "https://github.com/ralouphie/getallheaders/issues", + "source": "https://github.com/ralouphie/getallheaders/tree/develop" }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2020-10-23T09:01:57+00:00" + "time": "2019-03-08T08:55:37+00:00" }, { - "name": "symfony/polyfill-php72", - "version": "v1.19.0", + "name": "symfony/deprecation-contracts", + "version": "v3.2.1", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "beecef6b463b06954638f02378f52496cb84bacc" + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/beecef6b463b06954638f02378f52496cb84bacc", - "reference": "beecef6b463b06954638f02378f52496cb84bacc", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e", + "reference": "e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=8.1" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "1.19-dev" + "dev-main": "3.3-dev" }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" } }, "autoload": { "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php72\\": "" - } + "function.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -758,16 +581,10 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", + "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], "support": { - "source": "https://github.com/symfony/polyfill-php72/tree/v1.19.0" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.2.1" }, "funding": [ { @@ -783,7 +600,7 @@ "type": "tidelift" } ], - "time": "2020-10-23T09:01:57+00:00" + "time": "2023-03-01T10:25:55+00:00" } ], "packages-dev": [], @@ -793,7 +610,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "^7.0" + "php": ">=7.0" }, "platform-dev": [], "plugin-api-version": "2.3.0" diff --git a/examples/AuthorSearch.json b/examples/AuthorSearch.json new file mode 100644 index 0000000..af494bd --- /dev/null +++ b/examples/AuthorSearch.json @@ -0,0 +1 @@ +{"search-results":{"opensearch:totalResults":"1","opensearch:startIndex":"0","opensearch:itemsPerPage":"1","opensearch:Query":{"@role": "request", "@searchTerms": "AUTHLASTNAME(Howland) AND AUTHFIRST(J) AND AF-ID(60006832)", "@startPage": "0"},"link": [{"@_fa": "true", "@ref": "self", "@href": "https://api.elsevier.com/content/search/author?start=0&count=25&query=AUTHLASTNAME%28Howland%29+AND+AUTHFIRST%28J%29+AND+AF-ID%2860006832%29&apiKey=c29c9566c80d7b2dba4db28894ac26ce", "@type": "application/json"},{"@_fa": "true", "@ref": "first", "@href": "https://api.elsevier.com/content/search/author?start=0&count=25&query=AUTHLASTNAME%28Howland%29+AND+AUTHFIRST%28J%29+AND+AF-ID%2860006832%29&apiKey=c29c9566c80d7b2dba4db28894ac26ce", "@type": "application/json"}],"entry": [{"@_fa": "true", "link": [{"@_fa": "true", "@ref": "self", "@href": "https://api.elsevier.com/content/author/author_id/14071559700"},{"@_fa": "true", "@ref": "search", "@href": "https://api.elsevier.com/content/search/author?query=au-id%2814071559700%29"},{"@_fa": "true", "@ref": "scopus-citedby", "@href": "https://www.scopus.com/author/citedby.uri?partnerID=HzOxMe3b&citedAuthorId=14071559700&origin=inward"},{"@_fa": "true", "@ref": "scopus-author", "@href": "https://www.scopus.com/authid/detail.uri?partnerID=HzOxMe3b&authorId=14071559700&origin=inward"}],"prism:url":"https://api.elsevier.com/content/author/author_id/14071559700","dc:identifier":"AUTHOR_ID:14071559700","eid":"9-s2.0-14071559700","orcid":"0000-0001-6924-5389","preferred-name":{"surname":"Howland","given-name":"Jared L.","initials":"J.L."},"name-variant": [{"@_fa": "true", "surname":"Howland","given-name":"Jared","initials":"J."},{"@_fa": "true", "surname":"Howland","given-name":"Jared L.","initials":"J.L."}],"document-count":"4","subject-area": [{"@abbrev": "SOCI", "@frequency": "4", "$" :"Social Sciences (all)"},{"@abbrev": "COMP", "@frequency": "1", "$" :"Computer Science (all)"}],"affiliation-current":{"affiliation-url":"https://api.elsevier.com/content/affiliation/affiliation_id/60006832","affiliation-id":"60006832","affiliation-name":"Brigham Young University","affiliation-city":"Provo","affiliation-country":"United States"}}]}} \ No newline at end of file diff --git a/src/Scopus/Parser.php b/src/Scopus/Parser.php new file mode 100644 index 0000000..d76fec3 --- /dev/null +++ b/src/Scopus/Parser.php @@ -0,0 +1,52 @@ + + * + * @version 2017-11-30 + * + * @since 2017-11-29 + */ + +namespace Scopus; + +/** + * Parser Class + */ +class Parser +{ + protected $json; + protected $array; + protected $fields = []; + + /** + * Parser constructor + * + * @param string $json JSON to parse + */ + protected function __construct($json) + { + $this->json = $json; + $this->array = json_decode($this->json, true); + $this->array = $this->fixKeys($this->array); + } + + private function fixKeys($array) + { + $newArray = []; + foreach ($array as $key => $value) { + $search = ['_', '-', ':', '@']; + $replace = ['', '_', '_', '']; + $newArray[str_replace($search, $replace, $key)] = (is_array($value)) ? $this->fixKeys($value) : $value; + } + + return $newArray; + } + + public function retrieve() + { + return $this->fields; + } +} \ No newline at end of file diff --git a/src/Scopus/Parsers/AbstractRetrieval.php b/src/Scopus/Parsers/AbstractRetrieval.php new file mode 100644 index 0000000..5016e03 --- /dev/null +++ b/src/Scopus/Parsers/AbstractRetrieval.php @@ -0,0 +1,33 @@ + + * + * @version 2017-11-30 + * + * @since 2017-11-30 + */ + +namespace Scopus\Parsers; + +/** + * Parser Class + */ +class AbstractRetrieval extends \Scopus\Parser +{ + public function __construct($json) + { + parent::__construct($json); + } + + public function scopusId() + { + $scopusId = $this->json['abstracts-retrieval-response']['coredata']['dc:identifier']; + echo "id: '$scopusId'"; + $this->fields = array_merge($this->fields, ['scopusId' => $scopusId]); + return $this; + } +} \ No newline at end of file diff --git a/src/Scopus/Parsers/AffiliationRetrieval.php b/src/Scopus/Parsers/AffiliationRetrieval.php new file mode 100644 index 0000000..e1885c0 --- /dev/null +++ b/src/Scopus/Parsers/AffiliationRetrieval.php @@ -0,0 +1,55 @@ + + * + * @version 2017-11-30 + * + * @since 2017-11-30 + */ + +namespace Scopus\Parsers; + +use Exception; + +/** + * AffiliationRetrieval Class + */ +class AffiliationRetrieval extends \Scopus\Scopus +{ + private $id; + private $url; + + public function __construct($id, $idType, $apiKey = null, $timeout = null) + { + parent::__construct($apiKey, $timeout); + $this->id = $id; + $this->getUrl($idType); + } + + private function getUrl($idType) + { + switch ($idType) { + case 'affiliationId': + $this->url = self::AFFILIATION_RETRIEVAL_AF_ID; + break; + case 'eid': + $this->url = self::AFFILIATION_RETRIEVAL_EID; + break; + default: + throw new Exception('Incorrect ID Type used. Must be one of the following: `affiliationId` or `eid`'); + } + } + + public function search() + { + $search = array_merge($this->httpAccept, $this->access_token, $this->insttoken, $this->reqId, $this->ver, + $this->view, $this->field, $this->start, $this->count, $this->startref, + $this->refcount); + + return $this->getJson($this->url.$this->id, $search); + } +} \ No newline at end of file diff --git a/src/Scopus/Parsers/AffiliationSearch.php b/src/Scopus/Parsers/AffiliationSearch.php new file mode 100644 index 0000000..36717df --- /dev/null +++ b/src/Scopus/Parsers/AffiliationSearch.php @@ -0,0 +1,34 @@ + + * + * @version 2017-11-30 + * + * @since 2017-11-30 + */ + +namespace Scopus\Parsers; + +/** + * AffiliationSearch Class + */ +class AffiliationSearch extends \Scopus\Scopus +{ + public function __construct($apiKey = null, $timeout = null) + { + parent::__construct($apiKey, $timeout); + } + + public function search() + { + $search = array_merge($this->httpAccept, $this->access_token, $this->insttoken, $this->reqId, $this->ver, + $this->query, $this->view, $this->field, $this->suppressNavLinks, $this->start, + $this->count, $this->sort, $this->facets); + + return $this->getJson(self::AFFILIATION_SEARCH, $search); + } +} \ No newline at end of file diff --git a/src/Scopus/Parsers/AuthorRetrieval.php b/src/Scopus/Parsers/AuthorRetrieval.php new file mode 100644 index 0000000..63cca4d --- /dev/null +++ b/src/Scopus/Parsers/AuthorRetrieval.php @@ -0,0 +1,59 @@ + + * + * @version 2017-11-29 + * + * @since 2017-11-29 + */ + +namespace Scopus\Parsers; + +/** + * AuthorRetrieval Class + */ +class AuthorRetrieval extends \Scopus\Scopus +{ + private $eid = []; + private $author_id = []; + private $self_citation = []; + + public function __construct($apiKey = null, $timeout = null) + { + parent::__construct($apiKey, $timeout); + } + + public function eid($eid) + { + $this->eid = ['eid' => $eid]; + + return $this; + } + + public function author_id($author_id) + { + $this->author_id = ['author_id' => $author_id]; + + return $this; + } + + public function self_citation($self_citation) + { + $this->self_citation = ['self-citation' => $self_citation]; + + return $this; + } + + public function search() + { + $search = array_merge($this->httpAccept, $this->access_token, $this->insttoken, $this->reqId, $this->ver, + $this->eid, $this->author_id, $this->self_citation; + + return $this->getJson(self::AUTHOR_RETRIEVAL, $search); + } +} +?> \ No newline at end of file diff --git a/src/Scopus/Parsers/AuthorSearch.php b/src/Scopus/Parsers/AuthorSearch.php new file mode 100644 index 0000000..94b6baf --- /dev/null +++ b/src/Scopus/Parsers/AuthorSearch.php @@ -0,0 +1,71 @@ + + * + * @version 2017-12-04 + * + * @since 2017-12-04 + */ + +namespace Scopus\Parsers; + +/** + * AuthorSearch Parser Class + */ +class AuthorSearch extends \Scopus\Parser +{ + public function __construct($json) + { + parent::__construct($json); + } + + public function numResults() + { + $this->fields['numResults'] = $this->array['search_results']['opensearch_totalResults']; + + return $this; + } + + public function entries() + { + $this->fields['entries'] = $this->array['search_results']['entry']; + + return $this; + } + + public function entry($entry) + { + $this->links($entry['link']); + + return $this; + } + + public function links($links) + { + $allLinks = []; + foreach ($links as $value) { + switch ($links['ref']) { + case 'self': + $allLinks['api'] = $value; + break; + case 'search': + $allLinks['search'] = $value; + break; + case 'scopus_citedby': + $allLinks['citedBy'] = $value; + break; + case 'scopus_author': + $allLinks['author'] = $value; + break; + } + } + $this->fields['links'] = $allLinks; + + return $this; + } + +} \ No newline at end of file diff --git a/src/Scopus/Parsers/CitationsCount.php b/src/Scopus/Parsers/CitationsCount.php new file mode 100644 index 0000000..963b656 --- /dev/null +++ b/src/Scopus/Parsers/CitationsCount.php @@ -0,0 +1,33 @@ + + * + * @version 2017-11-30 + * + * @since 2017-11-30 + */ + +namespace Scopus\Parsers; + +/** + * CitationsCount Class + */ +class CitationsCount extends \Scopus\Scopus +{ + public function __construct($apiKey = null, $timeout = null) + { + parent::__construct($apiKey, $timeout); + } + + public function search() + { + $search = array_merge($this->httpAccept, $this->access_token, $this->insttoken, $this->reqId, $this->ver, + $this->scopus_id, $this->doi, $this->pii, $this->pubmed_id); + + return $this->getJson(self::CITATIONS_COUNT, $search); + } +} \ No newline at end of file diff --git a/src/Scopus/Parsers/CitationsOverview.php b/src/Scopus/Parsers/CitationsOverview.php new file mode 100644 index 0000000..c784450 --- /dev/null +++ b/src/Scopus/Parsers/CitationsOverview.php @@ -0,0 +1,51 @@ + + * + * @version 2017-11-30 + * + * @since 2017-11-30 + */ + +namespace Scopus\Parsers; + +/** + * CitationsOverview Class + */ +class CitationsOverview extends \Scopus\Scopus +{ + private $citation; + private $author_id; + + public function __construct($apiKey = null, $timeout = null) + { + parent::__construct($apiKey, $timeout); + } + + public function citation($citation) + { + $this->citation = ['citation' => $citation]; + + return $this; + } + + public function author_id($author_id) + { + $this->author_id = ['author_id' => $author_id]; + + return $this; + } + + public function search() + { + $search = array_merge($this->httpAccept, $this->access_token, $this->insttoken, $this->reqId, $this->ver, + $this->start, $this->count, $this->view, $this->field, $this->sort, $this->date, $this->citation, + $this->author_id, $this->scopus_id, $this->doi, $this->pii, $this->pubmed_id); + + return $this->getJson(self::CITATIONS_OVERVIEW, $search); + } +} \ No newline at end of file diff --git a/src/Scopus/Parsers/ScopusSearch.php b/src/Scopus/Parsers/ScopusSearch.php new file mode 100644 index 0000000..bc34db2 --- /dev/null +++ b/src/Scopus/Parsers/ScopusSearch.php @@ -0,0 +1,34 @@ + + * + * @version 2017-11-30 + * + * @since 2017-11-30 + */ + +namespace Scopus\Parsers; + +/** + * ScopusSearch Class + */ +class ScopusSearch extends \Scopus\Scopus +{ + public function __construct($apiKey = null, $timeout = null) + { + parent::__construct($apiKey, $timeout); + } + + public function search() + { + $search = array_merge($this->httpAccept, $this->access_token, $this->insttoken, $this->reqId, $this->ver, + $this->query, $this->view, $this->field, $this->suppressNavLinks, $this->date, + $this->start, $this->count, $this->sort, $this->content, $this->subj, $this->alias, $this->facets); + + return $this->getJson(self::SCOPUS_SEARCH, $search); + } +} \ No newline at end of file diff --git a/src/Scopus/Parsers/SerialTitle.php b/src/Scopus/Parsers/SerialTitle.php new file mode 100644 index 0000000..3d34310 --- /dev/null +++ b/src/Scopus/Parsers/SerialTitle.php @@ -0,0 +1,80 @@ + + * + * @version 2017-11-29 + * + * @since 2017-11-29 + */ + +namespace Scopus\Parsers; + +use Exception; + +/** + * SerialTitle Class + */ +class SerialTitle extends \Scopus\Scopus +{ + private $title = []; + private $issn = []; + private $pub = []; + private $oa = []; + + public function __construct($apiKey = null, $timeout = null) + { + parent::__construct($apiKey, $timeout); + } + + public function title($title) + { + $this->title = ['title' => $title]; + + return $this; + } + + public function issn($issn) + { + if ($this->isValidIssn($issn)) { + $this->issn = ['issn' => $issn]; + } else { + throw new Exception('The ISSN you entered is not valid.'); + } + + return $this; + } + + public function isValidIssn($issn) + { + $validate = new \Scopus\Validators\IssnValidator; + + return $validate->validate($issn); + } + + public function pub($pub) + { + $this->pub = ['pub' => $pub]; + + return $this; + } + + public function oa($oa) + { + $this->oa = ['oa' => $oa]; + + return $this; + } + + public function search() + { + $search = array_merge($this->httpAccept, $this->access_token, $this->insttoken, $this->reqId, $this->ver, + $this->start, $this->count, $this->view, $this->field, $this->title, + $this->issn, $this->pub, $this->subj, $this->content, $this->date, $this->oa); + + return $this->getJson(self::SERIAL_TITLE, $search); + } +} \ No newline at end of file diff --git a/src/Scopus/Parsers/SubjectClassifications.php b/src/Scopus/Parsers/SubjectClassifications.php new file mode 100644 index 0000000..c84f008 --- /dev/null +++ b/src/Scopus/Parsers/SubjectClassifications.php @@ -0,0 +1,93 @@ + + * + * @version 2017-11-30 + * + * @since 2017-11-30 + */ + +namespace Scopus\Parsers; + +use Exception; + +/** + * SubjectClassifications Class + */ +class SubjectClassifications extends \Scopus\Scopus +{ + private $url; + + private $description; + private $detail; + private $code; + private $parentCode; + private $abbrev; + + public function __construct($searchType, $apiKey = null, $timeout = null) + { + parent::__construct($apiKey, $timeout); + $this->getUrl($searchType); + } + + private function getUrl($searchType) + { + switch ($searchType) { + case 'scidir': + $this->url = self::SUBJECT_CLASSIFICATIONS_SCIDIR; + break; + case 'scopus': + $this->url = self::SUBJECT_CLASSIFICATIONS_SCOPUS; + break; + default: + throw new Exception('Incorrect ID Type used. Must be one of the following: `scidir` or `scopus`'); + } + } + + public function description($description) + { + $this->description = ['description' => $description]; + + return $this; + } + + public function detail($detail) + { + $this->detail = ['detail' => $detail]; + + return $this; + } + + public function code($code) + { + $this->code = ['code' => $code]; + + return $this; + } + + public function parentCode($parentCode) + { + $this->parentCode = ['parentCode' => $parentCode]; + + return $this; + } + + public function abbrev($abbrev) + { + $this->abbrev = ['abbrev' => $abbrev]; + + return $this; + } + + public function search() + { + $search = array_merge($this->httpAccept, $this->description, $this->detail, $this->code, $this->parentCode, + $this->abbrev, $this->field); + + return $this->getJson($this->url, $search); + } +} \ No newline at end of file diff --git a/src/Scopus/Search/AbstractRetrieval.php b/src/Scopus/Search/AbstractRetrieval.php new file mode 100644 index 0000000..4d6e0f5 --- /dev/null +++ b/src/Scopus/Search/AbstractRetrieval.php @@ -0,0 +1,66 @@ + + * + * @version 2017-11-30 + * + * @since 2017-11-30 + */ + +namespace Scopus\Search; + +use Exception; + +/** + * AbstractRetrieval Class + */ +class AbstractRetrieval extends \Scopus\Scopus +{ + private $id; + private $url; + + public function __construct($id, $idType, $apiKey = null, $timeout = null) + { + parent::__construct($apiKey, $timeout); + $this->id = $id; + $this->getUrl($idType); + } + + private function getUrl($idType) + { + switch ($idType) { + case 'scopusId': + $this->url = self::ABSTRACT_RETRIEVAL_SCOPUS_ID; + break; + case 'eid': + $this->url = self::ABSTRACT_RETRIEVAL_EID; + break; + case 'doi': + $this->url = self::ABSTRACT_RETRIEVAL_DOI; + break; + case 'pii': + $this->url = self::ABSTRACT_RETRIEVAL_PII; + break; + case 'pubmedId': + $this->url = self::ABSTRACT_RETRIEVAL_PUBMED_ID; + break; + case 'pui': + $this->url = self::ABSTRACT_RETRIEVAL_PUI; + break; + default: + throw new Exception('Incorrect ID Type used. Must be one of the following: `scopusId`, `eid`, `doi`, `pii`, `pubmedId`, or `pui`'); + } + } + + public function search() + { + $search = array_merge($this->httpAccept, $this->access_token, $this->insttoken, $this->reqId, $this->ver, + $this->view, $this->field, $this->startref, $this->refcount); + + return $this->getJson($this->url.$this->id, $search); + } +} \ No newline at end of file diff --git a/src/Scopus/Search/AffiliationRetrieval.php b/src/Scopus/Search/AffiliationRetrieval.php new file mode 100644 index 0000000..82c641a --- /dev/null +++ b/src/Scopus/Search/AffiliationRetrieval.php @@ -0,0 +1,55 @@ + + * + * @version 2017-11-30 + * + * @since 2017-11-30 + */ + +namespace Scopus\Search; + +use Exception; + +/** + * AffiliationRetrieval Class + */ +class AffiliationRetrieval extends \Scopus\Scopus +{ + private $id; + private $url; + + public function __construct($id, $idType, $apiKey = null, $timeout = null) + { + parent::__construct($apiKey, $timeout); + $this->id = $id; + $this->getUrl($idType); + } + + private function getUrl($idType) + { + switch ($idType) { + case 'affiliationId': + $this->url = self::AFFILIATION_RETRIEVAL_AF_ID; + break; + case 'eid': + $this->url = self::AFFILIATION_RETRIEVAL_EID; + break; + default: + throw new Exception('Incorrect ID Type used. Must be one of the following: `affiliationId` or `eid`'); + } + } + + public function search() + { + $search = array_merge($this->httpAccept, $this->access_token, $this->insttoken, $this->reqId, $this->ver, + $this->view, $this->field, $this->start, $this->count, $this->startref, + $this->refcount); + + return $this->getJson($this->url.$this->id, $search); + } +} \ No newline at end of file diff --git a/src/Scopus/Search/AffiliationSearch.php b/src/Scopus/Search/AffiliationSearch.php new file mode 100644 index 0000000..ec86854 --- /dev/null +++ b/src/Scopus/Search/AffiliationSearch.php @@ -0,0 +1,34 @@ + + * + * @version 2017-11-30 + * + * @since 2017-11-30 + */ + +namespace Scopus\Search; + +/** + * AffiliationSearch Class + */ +class AffiliationSearch extends \Scopus\Scopus +{ + public function __construct($apiKey = null, $timeout = null) + { + parent::__construct($apiKey, $timeout); + } + + public function search() + { + $search = array_merge($this->httpAccept, $this->access_token, $this->insttoken, $this->reqId, $this->ver, + $this->query, $this->view, $this->field, $this->suppressNavLinks, $this->start, + $this->count, $this->sort, $this->facets); + + return $this->getJson(self::AFFILIATION_SEARCH, $search); + } +} \ No newline at end of file diff --git a/src/Scopus/Search/AuthorRetrieval.php b/src/Scopus/Search/AuthorRetrieval.php new file mode 100644 index 0000000..e40e3b5 --- /dev/null +++ b/src/Scopus/Search/AuthorRetrieval.php @@ -0,0 +1,59 @@ + + * + * @version 2017-11-29 + * + * @since 2017-11-29 + */ + +namespace Scopus\Search; + +/** + * AuthorRetrieval Class + */ +class AuthorRetrieval extends \Scopus\Scopus +{ + private $eid = []; + private $author_id = []; + private $self_citation = []; + + public function __construct($apiKey = null, $timeout = null) + { + parent::__construct($apiKey, $timeout); + } + + public function eid($eid) + { + $this->eid = ['eid' => $eid]; + + return $this; + } + + public function author_id($author_id) + { + $this->author_id = ['author_id' => $author_id]; + + return $this; + } + + public function self_citation($self_citation) + { + $this->self_citation = ['self-citation' => $self_citation]; + + return $this; + } + + public function search() + { + $search = array_merge($this->httpAccept, $this->access_token, $this->insttoken, $this->reqId, $this->ver, + $this->eid, $this->author_id, $this->self_citation; + + return $this->getJson(self::AUTHOR_RETRIEVAL, $search); + } +} +?> \ No newline at end of file diff --git a/src/Scopus/Search/AuthorSearch.php b/src/Scopus/Search/AuthorSearch.php new file mode 100644 index 0000000..739a841 --- /dev/null +++ b/src/Scopus/Search/AuthorSearch.php @@ -0,0 +1,43 @@ + + * + * @version 2017-11-29 + * + * @since 2017-11-29 + */ + +namespace Scopus\Search; + +/** + * AuthorSearch Class + */ +class AuthorSearch extends \Scopus\Scopus +{ + private $co_author = []; + + public function __construct($apiKey = null, $timeout = null) + { + parent::__construct($apiKey, $timeout); + } + + public function co_author($co_author) + { + $this->co_author = ['co-author' => $co_author]; + + return $this; + } + + public function search() + { + $search = array_merge($this->httpAccept, $this->access_token, $this->insttoken, $this->reqId, $this->ver, + $this->query, $this->co_author, $this->view, $this->field, $this->suppressNavLinks, + $this->start, $this->count, $this->sort, $this->facets, $this->alias); + + return $this->getJson(self::AUTHOR_SEARCH, $search); + } +} \ No newline at end of file diff --git a/src/Scopus/Search/CitationsCount.php b/src/Scopus/Search/CitationsCount.php new file mode 100644 index 0000000..89497ef --- /dev/null +++ b/src/Scopus/Search/CitationsCount.php @@ -0,0 +1,33 @@ + + * + * @version 2017-11-30 + * + * @since 2017-11-30 + */ + +namespace Scopus\Search; + +/** + * CitationsCount Class + */ +class CitationsCount extends \Scopus\Scopus +{ + public function __construct($apiKey = null, $timeout = null) + { + parent::__construct($apiKey, $timeout); + } + + public function search() + { + $search = array_merge($this->httpAccept, $this->access_token, $this->insttoken, $this->reqId, $this->ver, + $this->scopus_id, $this->doi, $this->pii, $this->pubmed_id); + + return $this->getJson(self::CITATIONS_COUNT, $search); + } +} \ No newline at end of file diff --git a/src/Scopus/Search/CitationsOverview.php b/src/Scopus/Search/CitationsOverview.php new file mode 100644 index 0000000..cb8caf9 --- /dev/null +++ b/src/Scopus/Search/CitationsOverview.php @@ -0,0 +1,51 @@ + + * + * @version 2017-11-30 + * + * @since 2017-11-30 + */ + +namespace Scopus\Search; + +/** + * CitationsOverview Class + */ +class CitationsOverview extends \Scopus\Scopus +{ + private $citation; + private $author_id; + + public function __construct($apiKey = null, $timeout = null) + { + parent::__construct($apiKey, $timeout); + } + + public function citation($citation) + { + $this->citation = ['citation' => $citation]; + + return $this; + } + + public function author_id($author_id) + { + $this->author_id = ['author_id' => $author_id]; + + return $this; + } + + public function search() + { + $search = array_merge($this->httpAccept, $this->access_token, $this->insttoken, $this->reqId, $this->ver, + $this->start, $this->count, $this->view, $this->field, $this->sort, $this->date, $this->citation, + $this->author_id, $this->scopus_id, $this->doi, $this->pii, $this->pubmed_id); + + return $this->getJson(self::CITATIONS_OVERVIEW, $search); + } +} \ No newline at end of file diff --git a/src/Scopus/Search/ScopusSearch.php b/src/Scopus/Search/ScopusSearch.php new file mode 100644 index 0000000..bb4667a --- /dev/null +++ b/src/Scopus/Search/ScopusSearch.php @@ -0,0 +1,34 @@ + + * + * @version 2017-11-30 + * + * @since 2017-11-30 + */ + +namespace Scopus\Search; + +/** + * ScopusSearch Class + */ +class ScopusSearch extends \Scopus\Scopus +{ + public function __construct($apiKey = null, $timeout = null) + { + parent::__construct($apiKey, $timeout); + } + + public function search() + { + $search = array_merge($this->httpAccept, $this->access_token, $this->insttoken, $this->reqId, $this->ver, + $this->query, $this->view, $this->field, $this->suppressNavLinks, $this->date, + $this->start, $this->count, $this->sort, $this->content, $this->subj, $this->alias, $this->facets); + + return $this->getJson(self::SCOPUS_SEARCH, $search); + } +} \ No newline at end of file diff --git a/src/Scopus/Search/SerialTitle.php b/src/Scopus/Search/SerialTitle.php new file mode 100644 index 0000000..411f349 --- /dev/null +++ b/src/Scopus/Search/SerialTitle.php @@ -0,0 +1,80 @@ + + * + * @version 2017-11-29 + * + * @since 2017-11-29 + */ + +namespace Scopus\Search; + +use Exception; + +/** + * SerialTitle Class + */ +class SerialTitle extends \Scopus\Scopus +{ + private $title = []; + private $issn = []; + private $pub = []; + private $oa = []; + + public function __construct($apiKey = null, $timeout = null) + { + parent::__construct($apiKey, $timeout); + } + + public function title($title) + { + $this->title = ['title' => $title]; + + return $this; + } + + public function issn($issn) + { + if ($this->isValidIssn($issn)) { + $this->issn = ['issn' => $issn]; + } else { + throw new Exception('The ISSN you entered is not valid.'); + } + + return $this; + } + + public function isValidIssn($issn) + { + $validate = new \Scopus\Validators\IssnValidator; + + return $validate->validate($issn); + } + + public function pub($pub) + { + $this->pub = ['pub' => $pub]; + + return $this; + } + + public function oa($oa) + { + $this->oa = ['oa' => $oa]; + + return $this; + } + + public function search() + { + $search = array_merge($this->httpAccept, $this->access_token, $this->insttoken, $this->reqId, $this->ver, + $this->start, $this->count, $this->view, $this->field, $this->title, + $this->issn, $this->pub, $this->subj, $this->content, $this->date, $this->oa); + + return $this->getJson(self::SERIAL_TITLE, $search); + } +} \ No newline at end of file diff --git a/src/Scopus/Search/SubjectClassifications.php b/src/Scopus/Search/SubjectClassifications.php new file mode 100644 index 0000000..677e8c1 --- /dev/null +++ b/src/Scopus/Search/SubjectClassifications.php @@ -0,0 +1,93 @@ + + * + * @version 2017-11-30 + * + * @since 2017-11-30 + */ + +namespace Scopus\Search; + +use Exception; + +/** + * SubjectClassifications Class + */ +class SubjectClassifications extends \Scopus\Scopus +{ + private $url; + + private $description; + private $detail; + private $code; + private $parentCode; + private $abbrev; + + public function __construct($searchType, $apiKey = null, $timeout = null) + { + parent::__construct($apiKey, $timeout); + $this->getUrl($searchType); + } + + private function getUrl($searchType) + { + switch ($searchType) { + case 'scidir': + $this->url = self::SUBJECT_CLASSIFICATIONS_SCIDIR; + break; + case 'scopus': + $this->url = self::SUBJECT_CLASSIFICATIONS_SCOPUS; + break; + default: + throw new Exception('Incorrect ID Type used. Must be one of the following: `scidir` or `scopus`'); + } + } + + public function description($description) + { + $this->description = ['description' => $description]; + + return $this; + } + + public function detail($detail) + { + $this->detail = ['detail' => $detail]; + + return $this; + } + + public function code($code) + { + $this->code = ['code' => $code]; + + return $this; + } + + public function parentCode($parentCode) + { + $this->parentCode = ['parentCode' => $parentCode]; + + return $this; + } + + public function abbrev($abbrev) + { + $this->abbrev = ['abbrev' => $abbrev]; + + return $this; + } + + public function search() + { + $search = array_merge($this->httpAccept, $this->description, $this->detail, $this->code, $this->parentCode, + $this->abbrev, $this->field); + + return $this->getJson($this->url, $search); + } +} \ No newline at end of file From 125e70b96c77fff289624352f27a0c10e020abd5 Mon Sep 17 00:00:00 2001 From: Jared Howland Date: Wed, 24 May 2023 12:03:06 -0600 Subject: [PATCH 2/2] [FIX] Namespace problems * Convert to PSR-4 --- README.md | 8 +- composer.json | 9 +- composer.lock | 158 +++++++++++++++++- examples/AuthorSearch.json | 1 - src/{Scopus => }/AbstractRetrieval.php | 2 +- src/{Scopus => }/AffiliationRetrieval.php | 2 +- src/{Scopus => }/AffiliationSearch.php | 2 +- src/{Scopus => }/AuthorRetrieval.php | 1 - src/{Scopus => }/AuthorSearch.php | 4 +- src/{Scopus => }/CitationsCount.php | 2 +- src/{Scopus => }/CitationsOverview.php | 2 +- src/{Scopus => }/Parser.php | 2 +- src/{Scopus => }/Scopus.php | 10 +- src/Scopus/Parsers/AbstractRetrieval.php | 33 ---- src/Scopus/Parsers/AffiliationRetrieval.php | 55 ------ src/Scopus/Parsers/AffiliationSearch.php | 34 ---- src/Scopus/Parsers/AuthorRetrieval.php | 59 ------- src/Scopus/Parsers/AuthorSearch.php | 71 -------- src/Scopus/Parsers/CitationsCount.php | 33 ---- src/Scopus/Parsers/CitationsOverview.php | 51 ------ src/Scopus/Parsers/ScopusSearch.php | 34 ---- src/Scopus/Parsers/SerialTitle.php | 80 --------- src/Scopus/Parsers/SubjectClassifications.php | 93 ----------- src/Scopus/Search/AbstractRetrieval.php | 66 -------- src/Scopus/Search/AffiliationRetrieval.php | 55 ------ src/Scopus/Search/AffiliationSearch.php | 34 ---- src/Scopus/Search/AuthorRetrieval.php | 59 ------- src/Scopus/Search/AuthorSearch.php | 43 ----- src/Scopus/Search/CitationsCount.php | 33 ---- src/Scopus/Search/CitationsOverview.php | 51 ------ src/Scopus/Search/ScopusSearch.php | 34 ---- src/Scopus/Search/SerialTitle.php | 80 --------- src/Scopus/Search/SubjectClassifications.php | 93 ----------- src/{Scopus => }/ScopusSearch.php | 2 +- src/{Scopus => }/SerialTitle.php | 22 +-- src/{Scopus => }/SubjectClassifications.php | 2 +- src/{Scopus => }/Validators/IsbnValidator.php | 0 src/{Scopus => }/Validators/IssnValidator.php | 0 src/{Scopus => }/Validators/LICENSE.md | 0 src/{Scopus => }/Validators/Validator.php | 0 40 files changed, 196 insertions(+), 1124 deletions(-) delete mode 100644 examples/AuthorSearch.json rename src/{Scopus => }/AbstractRetrieval.php (99%) rename src/{Scopus => }/AffiliationRetrieval.php (99%) rename src/{Scopus => }/AffiliationSearch.php (99%) rename src/{Scopus => }/AuthorRetrieval.php (99%) rename src/{Scopus => }/AuthorSearch.php (97%) rename src/{Scopus => }/CitationsCount.php (99%) rename src/{Scopus => }/CitationsOverview.php (99%) rename src/{Scopus => }/Parser.php (99%) rename src/{Scopus => }/Scopus.php (98%) delete mode 100644 src/Scopus/Parsers/AbstractRetrieval.php delete mode 100644 src/Scopus/Parsers/AffiliationRetrieval.php delete mode 100644 src/Scopus/Parsers/AffiliationSearch.php delete mode 100644 src/Scopus/Parsers/AuthorRetrieval.php delete mode 100644 src/Scopus/Parsers/AuthorSearch.php delete mode 100644 src/Scopus/Parsers/CitationsCount.php delete mode 100644 src/Scopus/Parsers/CitationsOverview.php delete mode 100644 src/Scopus/Parsers/ScopusSearch.php delete mode 100644 src/Scopus/Parsers/SerialTitle.php delete mode 100644 src/Scopus/Parsers/SubjectClassifications.php delete mode 100644 src/Scopus/Search/AbstractRetrieval.php delete mode 100644 src/Scopus/Search/AffiliationRetrieval.php delete mode 100644 src/Scopus/Search/AffiliationSearch.php delete mode 100644 src/Scopus/Search/AuthorRetrieval.php delete mode 100644 src/Scopus/Search/AuthorSearch.php delete mode 100644 src/Scopus/Search/CitationsCount.php delete mode 100644 src/Scopus/Search/CitationsOverview.php delete mode 100644 src/Scopus/Search/ScopusSearch.php delete mode 100644 src/Scopus/Search/SerialTitle.php delete mode 100644 src/Scopus/Search/SubjectClassifications.php rename src/{Scopus => }/ScopusSearch.php (99%) rename src/{Scopus => }/SerialTitle.php (86%) rename src/{Scopus => }/SubjectClassifications.php (99%) rename src/{Scopus => }/Validators/IsbnValidator.php (100%) rename src/{Scopus => }/Validators/IssnValidator.php (100%) rename src/{Scopus => }/Validators/LICENSE.md (100%) rename src/{Scopus => }/Validators/Validator.php (100%) diff --git a/README.md b/README.md index 02a78c1..23801ba 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ $results = $affiliationSearch Example `JSON` response: -``` +```json { "search-results": { "opensearch:totalResults": "992", @@ -162,7 +162,7 @@ $results = $authorSearch Example `JSON` response: -``` +```json { "search-results": { "opensearch:totalResults": "1", @@ -268,7 +268,7 @@ $results = $scopusSearch Example `JSON` response: -``` +```json { "search-results": { "opensearch:totalResults": "432", @@ -390,7 +390,7 @@ For example: Example `JSON` response: -``` +```json { "abstracts-retrieval-response": { "coredata": { diff --git a/composer.json b/composer.json index 22a6917..abadaf3 100644 --- a/composer.json +++ b/composer.json @@ -4,19 +4,20 @@ "homepage": "https://github.com/hbll-collection-development/scopus-api", "license": "MIT", "autoload": { - "psr-0": { - "Scopus": "src" + "psr-4": { + "Scopus\\": "src" } }, "authors": [ { "name": "Jared Howland", - "homepage": "http://jaredhowland.com", + "homepage": "https://www.jaredhowland.com", "role": "developer" } ], "require": { "php": ">=7.0", - "guzzlehttp/guzzle": "^7.0" + "guzzlehttp/guzzle": "^7.0", + "symfony/yaml": "^6.2" } } diff --git a/composer.lock b/composer.lock index ad7b49c..a1f7fa9 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "2f72b2d429c777dc6aa3a55572e25caa", + "content-hash": "b848522eacf2982e84d9efc3b4dc414d", "packages": [ { "name": "guzzlehttp/guzzle", @@ -601,6 +601,162 @@ } ], "time": "2023-03-01T10:25:55+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.27.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "5bbc823adecdae860bb64756d639ecfec17b050a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/5bbc823adecdae860bb64756d639ecfec17b050a", + "reference": "5bbc823adecdae860bb64756d639ecfec17b050a", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-ctype": "*" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.27-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.27.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-11-03T14:55:06+00:00" + }, + { + "name": "symfony/yaml", + "version": "v6.2.10", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "61916f3861b1e9705b18cfde723921a71dd1559d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/61916f3861b1e9705b18cfde723921a71dd1559d", + "reference": "61916f3861b1e9705b18cfde723921a71dd1559d", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "symfony/polyfill-ctype": "^1.8" + }, + "conflict": { + "symfony/console": "<5.4" + }, + "require-dev": { + "symfony/console": "^5.4|^6.0" + }, + "suggest": { + "symfony/console": "For validating YAML files using the lint command" + }, + "bin": [ + "Resources/bin/yaml-lint" + ], + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Loads and dumps YAML files", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/yaml/tree/v6.2.10" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-04-28T13:25:36+00:00" } ], "packages-dev": [], diff --git a/examples/AuthorSearch.json b/examples/AuthorSearch.json deleted file mode 100644 index af494bd..0000000 --- a/examples/AuthorSearch.json +++ /dev/null @@ -1 +0,0 @@ -{"search-results":{"opensearch:totalResults":"1","opensearch:startIndex":"0","opensearch:itemsPerPage":"1","opensearch:Query":{"@role": "request", "@searchTerms": "AUTHLASTNAME(Howland) AND AUTHFIRST(J) AND AF-ID(60006832)", "@startPage": "0"},"link": [{"@_fa": "true", "@ref": "self", "@href": "https://api.elsevier.com/content/search/author?start=0&count=25&query=AUTHLASTNAME%28Howland%29+AND+AUTHFIRST%28J%29+AND+AF-ID%2860006832%29&apiKey=c29c9566c80d7b2dba4db28894ac26ce", "@type": "application/json"},{"@_fa": "true", "@ref": "first", "@href": "https://api.elsevier.com/content/search/author?start=0&count=25&query=AUTHLASTNAME%28Howland%29+AND+AUTHFIRST%28J%29+AND+AF-ID%2860006832%29&apiKey=c29c9566c80d7b2dba4db28894ac26ce", "@type": "application/json"}],"entry": [{"@_fa": "true", "link": [{"@_fa": "true", "@ref": "self", "@href": "https://api.elsevier.com/content/author/author_id/14071559700"},{"@_fa": "true", "@ref": "search", "@href": "https://api.elsevier.com/content/search/author?query=au-id%2814071559700%29"},{"@_fa": "true", "@ref": "scopus-citedby", "@href": "https://www.scopus.com/author/citedby.uri?partnerID=HzOxMe3b&citedAuthorId=14071559700&origin=inward"},{"@_fa": "true", "@ref": "scopus-author", "@href": "https://www.scopus.com/authid/detail.uri?partnerID=HzOxMe3b&authorId=14071559700&origin=inward"}],"prism:url":"https://api.elsevier.com/content/author/author_id/14071559700","dc:identifier":"AUTHOR_ID:14071559700","eid":"9-s2.0-14071559700","orcid":"0000-0001-6924-5389","preferred-name":{"surname":"Howland","given-name":"Jared L.","initials":"J.L."},"name-variant": [{"@_fa": "true", "surname":"Howland","given-name":"Jared","initials":"J."},{"@_fa": "true", "surname":"Howland","given-name":"Jared L.","initials":"J.L."}],"document-count":"4","subject-area": [{"@abbrev": "SOCI", "@frequency": "4", "$" :"Social Sciences (all)"},{"@abbrev": "COMP", "@frequency": "1", "$" :"Computer Science (all)"}],"affiliation-current":{"affiliation-url":"https://api.elsevier.com/content/affiliation/affiliation_id/60006832","affiliation-id":"60006832","affiliation-name":"Brigham Young University","affiliation-city":"Provo","affiliation-country":"United States"}}]}} \ No newline at end of file diff --git a/src/Scopus/AbstractRetrieval.php b/src/AbstractRetrieval.php similarity index 99% rename from src/Scopus/AbstractRetrieval.php rename to src/AbstractRetrieval.php index 1234867..1356b5b 100644 --- a/src/Scopus/AbstractRetrieval.php +++ b/src/AbstractRetrieval.php @@ -63,4 +63,4 @@ public function search() return $this->getJson($this->url.$this->id, $search); } -} \ No newline at end of file +} diff --git a/src/Scopus/AffiliationRetrieval.php b/src/AffiliationRetrieval.php similarity index 99% rename from src/Scopus/AffiliationRetrieval.php rename to src/AffiliationRetrieval.php index 70a0663..bc15724 100644 --- a/src/Scopus/AffiliationRetrieval.php +++ b/src/AffiliationRetrieval.php @@ -52,4 +52,4 @@ public function search() return $this->getJson($this->url.$this->id, $search); } -} \ No newline at end of file +} diff --git a/src/Scopus/AffiliationSearch.php b/src/AffiliationSearch.php similarity index 99% rename from src/Scopus/AffiliationSearch.php rename to src/AffiliationSearch.php index 93da058..40c9656 100644 --- a/src/Scopus/AffiliationSearch.php +++ b/src/AffiliationSearch.php @@ -31,4 +31,4 @@ public function search() return $this->getJson(self::AFFILIATION_SEARCH, $search); } -} \ No newline at end of file +} diff --git a/src/Scopus/AuthorRetrieval.php b/src/AuthorRetrieval.php similarity index 99% rename from src/Scopus/AuthorRetrieval.php rename to src/AuthorRetrieval.php index 74e20de..d17c590 100644 --- a/src/Scopus/AuthorRetrieval.php +++ b/src/AuthorRetrieval.php @@ -56,4 +56,3 @@ public function search() return $this->getJson(self::AUTHOR_RETRIEVAL, $search); } } -?> \ No newline at end of file diff --git a/src/Scopus/AuthorSearch.php b/src/AuthorSearch.php similarity index 97% rename from src/Scopus/AuthorSearch.php rename to src/AuthorSearch.php index f0710a2..0a92e9b 100644 --- a/src/Scopus/AuthorSearch.php +++ b/src/AuthorSearch.php @@ -6,7 +6,7 @@ * * @author Jared Howland * - * @version 2017-11-29 + * @version 2023-05-24 * * @since 2017-11-29 */ @@ -40,4 +40,4 @@ public function search() return $this->getJson(self::AUTHOR_SEARCH, $search); } -} \ No newline at end of file +} diff --git a/src/Scopus/CitationsCount.php b/src/CitationsCount.php similarity index 99% rename from src/Scopus/CitationsCount.php rename to src/CitationsCount.php index 2bff820..1780546 100644 --- a/src/Scopus/CitationsCount.php +++ b/src/CitationsCount.php @@ -30,4 +30,4 @@ public function search() return $this->getJson(self::CITATIONS_COUNT, $search); } -} \ No newline at end of file +} diff --git a/src/Scopus/CitationsOverview.php b/src/CitationsOverview.php similarity index 99% rename from src/Scopus/CitationsOverview.php rename to src/CitationsOverview.php index 6841a86..ab47736 100644 --- a/src/Scopus/CitationsOverview.php +++ b/src/CitationsOverview.php @@ -48,4 +48,4 @@ public function search() return $this->getJson(self::CITATIONS_OVERVIEW, $search); } -} \ No newline at end of file +} diff --git a/src/Scopus/Parser.php b/src/Parser.php similarity index 99% rename from src/Scopus/Parser.php rename to src/Parser.php index d76fec3..da0afca 100644 --- a/src/Scopus/Parser.php +++ b/src/Parser.php @@ -49,4 +49,4 @@ public function retrieve() { return $this->fields; } -} \ No newline at end of file +} diff --git a/src/Scopus/Scopus.php b/src/Scopus.php similarity index 98% rename from src/Scopus/Scopus.php rename to src/Scopus.php index 69f1eaf..2390a4a 100644 --- a/src/Scopus/Scopus.php +++ b/src/Scopus.php @@ -83,6 +83,7 @@ class Scopus protected $view = []; protected $facets = []; protected $subj = []; + protected $subjCode = []; protected $content = []; protected $suppressNavLinks = []; protected $field = []; @@ -205,6 +206,13 @@ public function subj($subj) return $this; } + public function subjCode($subjCode) + { + $this->subjCode = ['subjCode' => $subjCode]; + + return $this; + } + public function content($content) { $this->content = ['content' => $content]; @@ -296,4 +304,4 @@ protected function getJson($url, $params) return (string)$response->getBody(); } -} \ No newline at end of file +} diff --git a/src/Scopus/Parsers/AbstractRetrieval.php b/src/Scopus/Parsers/AbstractRetrieval.php deleted file mode 100644 index 5016e03..0000000 --- a/src/Scopus/Parsers/AbstractRetrieval.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * @version 2017-11-30 - * - * @since 2017-11-30 - */ - -namespace Scopus\Parsers; - -/** - * Parser Class - */ -class AbstractRetrieval extends \Scopus\Parser -{ - public function __construct($json) - { - parent::__construct($json); - } - - public function scopusId() - { - $scopusId = $this->json['abstracts-retrieval-response']['coredata']['dc:identifier']; - echo "id: '$scopusId'"; - $this->fields = array_merge($this->fields, ['scopusId' => $scopusId]); - return $this; - } -} \ No newline at end of file diff --git a/src/Scopus/Parsers/AffiliationRetrieval.php b/src/Scopus/Parsers/AffiliationRetrieval.php deleted file mode 100644 index e1885c0..0000000 --- a/src/Scopus/Parsers/AffiliationRetrieval.php +++ /dev/null @@ -1,55 +0,0 @@ - - * - * @version 2017-11-30 - * - * @since 2017-11-30 - */ - -namespace Scopus\Parsers; - -use Exception; - -/** - * AffiliationRetrieval Class - */ -class AffiliationRetrieval extends \Scopus\Scopus -{ - private $id; - private $url; - - public function __construct($id, $idType, $apiKey = null, $timeout = null) - { - parent::__construct($apiKey, $timeout); - $this->id = $id; - $this->getUrl($idType); - } - - private function getUrl($idType) - { - switch ($idType) { - case 'affiliationId': - $this->url = self::AFFILIATION_RETRIEVAL_AF_ID; - break; - case 'eid': - $this->url = self::AFFILIATION_RETRIEVAL_EID; - break; - default: - throw new Exception('Incorrect ID Type used. Must be one of the following: `affiliationId` or `eid`'); - } - } - - public function search() - { - $search = array_merge($this->httpAccept, $this->access_token, $this->insttoken, $this->reqId, $this->ver, - $this->view, $this->field, $this->start, $this->count, $this->startref, - $this->refcount); - - return $this->getJson($this->url.$this->id, $search); - } -} \ No newline at end of file diff --git a/src/Scopus/Parsers/AffiliationSearch.php b/src/Scopus/Parsers/AffiliationSearch.php deleted file mode 100644 index 36717df..0000000 --- a/src/Scopus/Parsers/AffiliationSearch.php +++ /dev/null @@ -1,34 +0,0 @@ - - * - * @version 2017-11-30 - * - * @since 2017-11-30 - */ - -namespace Scopus\Parsers; - -/** - * AffiliationSearch Class - */ -class AffiliationSearch extends \Scopus\Scopus -{ - public function __construct($apiKey = null, $timeout = null) - { - parent::__construct($apiKey, $timeout); - } - - public function search() - { - $search = array_merge($this->httpAccept, $this->access_token, $this->insttoken, $this->reqId, $this->ver, - $this->query, $this->view, $this->field, $this->suppressNavLinks, $this->start, - $this->count, $this->sort, $this->facets); - - return $this->getJson(self::AFFILIATION_SEARCH, $search); - } -} \ No newline at end of file diff --git a/src/Scopus/Parsers/AuthorRetrieval.php b/src/Scopus/Parsers/AuthorRetrieval.php deleted file mode 100644 index 63cca4d..0000000 --- a/src/Scopus/Parsers/AuthorRetrieval.php +++ /dev/null @@ -1,59 +0,0 @@ - - * - * @version 2017-11-29 - * - * @since 2017-11-29 - */ - -namespace Scopus\Parsers; - -/** - * AuthorRetrieval Class - */ -class AuthorRetrieval extends \Scopus\Scopus -{ - private $eid = []; - private $author_id = []; - private $self_citation = []; - - public function __construct($apiKey = null, $timeout = null) - { - parent::__construct($apiKey, $timeout); - } - - public function eid($eid) - { - $this->eid = ['eid' => $eid]; - - return $this; - } - - public function author_id($author_id) - { - $this->author_id = ['author_id' => $author_id]; - - return $this; - } - - public function self_citation($self_citation) - { - $this->self_citation = ['self-citation' => $self_citation]; - - return $this; - } - - public function search() - { - $search = array_merge($this->httpAccept, $this->access_token, $this->insttoken, $this->reqId, $this->ver, - $this->eid, $this->author_id, $this->self_citation; - - return $this->getJson(self::AUTHOR_RETRIEVAL, $search); - } -} -?> \ No newline at end of file diff --git a/src/Scopus/Parsers/AuthorSearch.php b/src/Scopus/Parsers/AuthorSearch.php deleted file mode 100644 index 94b6baf..0000000 --- a/src/Scopus/Parsers/AuthorSearch.php +++ /dev/null @@ -1,71 +0,0 @@ - - * - * @version 2017-12-04 - * - * @since 2017-12-04 - */ - -namespace Scopus\Parsers; - -/** - * AuthorSearch Parser Class - */ -class AuthorSearch extends \Scopus\Parser -{ - public function __construct($json) - { - parent::__construct($json); - } - - public function numResults() - { - $this->fields['numResults'] = $this->array['search_results']['opensearch_totalResults']; - - return $this; - } - - public function entries() - { - $this->fields['entries'] = $this->array['search_results']['entry']; - - return $this; - } - - public function entry($entry) - { - $this->links($entry['link']); - - return $this; - } - - public function links($links) - { - $allLinks = []; - foreach ($links as $value) { - switch ($links['ref']) { - case 'self': - $allLinks['api'] = $value; - break; - case 'search': - $allLinks['search'] = $value; - break; - case 'scopus_citedby': - $allLinks['citedBy'] = $value; - break; - case 'scopus_author': - $allLinks['author'] = $value; - break; - } - } - $this->fields['links'] = $allLinks; - - return $this; - } - -} \ No newline at end of file diff --git a/src/Scopus/Parsers/CitationsCount.php b/src/Scopus/Parsers/CitationsCount.php deleted file mode 100644 index 963b656..0000000 --- a/src/Scopus/Parsers/CitationsCount.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * @version 2017-11-30 - * - * @since 2017-11-30 - */ - -namespace Scopus\Parsers; - -/** - * CitationsCount Class - */ -class CitationsCount extends \Scopus\Scopus -{ - public function __construct($apiKey = null, $timeout = null) - { - parent::__construct($apiKey, $timeout); - } - - public function search() - { - $search = array_merge($this->httpAccept, $this->access_token, $this->insttoken, $this->reqId, $this->ver, - $this->scopus_id, $this->doi, $this->pii, $this->pubmed_id); - - return $this->getJson(self::CITATIONS_COUNT, $search); - } -} \ No newline at end of file diff --git a/src/Scopus/Parsers/CitationsOverview.php b/src/Scopus/Parsers/CitationsOverview.php deleted file mode 100644 index c784450..0000000 --- a/src/Scopus/Parsers/CitationsOverview.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * @version 2017-11-30 - * - * @since 2017-11-30 - */ - -namespace Scopus\Parsers; - -/** - * CitationsOverview Class - */ -class CitationsOverview extends \Scopus\Scopus -{ - private $citation; - private $author_id; - - public function __construct($apiKey = null, $timeout = null) - { - parent::__construct($apiKey, $timeout); - } - - public function citation($citation) - { - $this->citation = ['citation' => $citation]; - - return $this; - } - - public function author_id($author_id) - { - $this->author_id = ['author_id' => $author_id]; - - return $this; - } - - public function search() - { - $search = array_merge($this->httpAccept, $this->access_token, $this->insttoken, $this->reqId, $this->ver, - $this->start, $this->count, $this->view, $this->field, $this->sort, $this->date, $this->citation, - $this->author_id, $this->scopus_id, $this->doi, $this->pii, $this->pubmed_id); - - return $this->getJson(self::CITATIONS_OVERVIEW, $search); - } -} \ No newline at end of file diff --git a/src/Scopus/Parsers/ScopusSearch.php b/src/Scopus/Parsers/ScopusSearch.php deleted file mode 100644 index bc34db2..0000000 --- a/src/Scopus/Parsers/ScopusSearch.php +++ /dev/null @@ -1,34 +0,0 @@ - - * - * @version 2017-11-30 - * - * @since 2017-11-30 - */ - -namespace Scopus\Parsers; - -/** - * ScopusSearch Class - */ -class ScopusSearch extends \Scopus\Scopus -{ - public function __construct($apiKey = null, $timeout = null) - { - parent::__construct($apiKey, $timeout); - } - - public function search() - { - $search = array_merge($this->httpAccept, $this->access_token, $this->insttoken, $this->reqId, $this->ver, - $this->query, $this->view, $this->field, $this->suppressNavLinks, $this->date, - $this->start, $this->count, $this->sort, $this->content, $this->subj, $this->alias, $this->facets); - - return $this->getJson(self::SCOPUS_SEARCH, $search); - } -} \ No newline at end of file diff --git a/src/Scopus/Parsers/SerialTitle.php b/src/Scopus/Parsers/SerialTitle.php deleted file mode 100644 index 3d34310..0000000 --- a/src/Scopus/Parsers/SerialTitle.php +++ /dev/null @@ -1,80 +0,0 @@ - - * - * @version 2017-11-29 - * - * @since 2017-11-29 - */ - -namespace Scopus\Parsers; - -use Exception; - -/** - * SerialTitle Class - */ -class SerialTitle extends \Scopus\Scopus -{ - private $title = []; - private $issn = []; - private $pub = []; - private $oa = []; - - public function __construct($apiKey = null, $timeout = null) - { - parent::__construct($apiKey, $timeout); - } - - public function title($title) - { - $this->title = ['title' => $title]; - - return $this; - } - - public function issn($issn) - { - if ($this->isValidIssn($issn)) { - $this->issn = ['issn' => $issn]; - } else { - throw new Exception('The ISSN you entered is not valid.'); - } - - return $this; - } - - public function isValidIssn($issn) - { - $validate = new \Scopus\Validators\IssnValidator; - - return $validate->validate($issn); - } - - public function pub($pub) - { - $this->pub = ['pub' => $pub]; - - return $this; - } - - public function oa($oa) - { - $this->oa = ['oa' => $oa]; - - return $this; - } - - public function search() - { - $search = array_merge($this->httpAccept, $this->access_token, $this->insttoken, $this->reqId, $this->ver, - $this->start, $this->count, $this->view, $this->field, $this->title, - $this->issn, $this->pub, $this->subj, $this->content, $this->date, $this->oa); - - return $this->getJson(self::SERIAL_TITLE, $search); - } -} \ No newline at end of file diff --git a/src/Scopus/Parsers/SubjectClassifications.php b/src/Scopus/Parsers/SubjectClassifications.php deleted file mode 100644 index c84f008..0000000 --- a/src/Scopus/Parsers/SubjectClassifications.php +++ /dev/null @@ -1,93 +0,0 @@ - - * - * @version 2017-11-30 - * - * @since 2017-11-30 - */ - -namespace Scopus\Parsers; - -use Exception; - -/** - * SubjectClassifications Class - */ -class SubjectClassifications extends \Scopus\Scopus -{ - private $url; - - private $description; - private $detail; - private $code; - private $parentCode; - private $abbrev; - - public function __construct($searchType, $apiKey = null, $timeout = null) - { - parent::__construct($apiKey, $timeout); - $this->getUrl($searchType); - } - - private function getUrl($searchType) - { - switch ($searchType) { - case 'scidir': - $this->url = self::SUBJECT_CLASSIFICATIONS_SCIDIR; - break; - case 'scopus': - $this->url = self::SUBJECT_CLASSIFICATIONS_SCOPUS; - break; - default: - throw new Exception('Incorrect ID Type used. Must be one of the following: `scidir` or `scopus`'); - } - } - - public function description($description) - { - $this->description = ['description' => $description]; - - return $this; - } - - public function detail($detail) - { - $this->detail = ['detail' => $detail]; - - return $this; - } - - public function code($code) - { - $this->code = ['code' => $code]; - - return $this; - } - - public function parentCode($parentCode) - { - $this->parentCode = ['parentCode' => $parentCode]; - - return $this; - } - - public function abbrev($abbrev) - { - $this->abbrev = ['abbrev' => $abbrev]; - - return $this; - } - - public function search() - { - $search = array_merge($this->httpAccept, $this->description, $this->detail, $this->code, $this->parentCode, - $this->abbrev, $this->field); - - return $this->getJson($this->url, $search); - } -} \ No newline at end of file diff --git a/src/Scopus/Search/AbstractRetrieval.php b/src/Scopus/Search/AbstractRetrieval.php deleted file mode 100644 index 4d6e0f5..0000000 --- a/src/Scopus/Search/AbstractRetrieval.php +++ /dev/null @@ -1,66 +0,0 @@ - - * - * @version 2017-11-30 - * - * @since 2017-11-30 - */ - -namespace Scopus\Search; - -use Exception; - -/** - * AbstractRetrieval Class - */ -class AbstractRetrieval extends \Scopus\Scopus -{ - private $id; - private $url; - - public function __construct($id, $idType, $apiKey = null, $timeout = null) - { - parent::__construct($apiKey, $timeout); - $this->id = $id; - $this->getUrl($idType); - } - - private function getUrl($idType) - { - switch ($idType) { - case 'scopusId': - $this->url = self::ABSTRACT_RETRIEVAL_SCOPUS_ID; - break; - case 'eid': - $this->url = self::ABSTRACT_RETRIEVAL_EID; - break; - case 'doi': - $this->url = self::ABSTRACT_RETRIEVAL_DOI; - break; - case 'pii': - $this->url = self::ABSTRACT_RETRIEVAL_PII; - break; - case 'pubmedId': - $this->url = self::ABSTRACT_RETRIEVAL_PUBMED_ID; - break; - case 'pui': - $this->url = self::ABSTRACT_RETRIEVAL_PUI; - break; - default: - throw new Exception('Incorrect ID Type used. Must be one of the following: `scopusId`, `eid`, `doi`, `pii`, `pubmedId`, or `pui`'); - } - } - - public function search() - { - $search = array_merge($this->httpAccept, $this->access_token, $this->insttoken, $this->reqId, $this->ver, - $this->view, $this->field, $this->startref, $this->refcount); - - return $this->getJson($this->url.$this->id, $search); - } -} \ No newline at end of file diff --git a/src/Scopus/Search/AffiliationRetrieval.php b/src/Scopus/Search/AffiliationRetrieval.php deleted file mode 100644 index 82c641a..0000000 --- a/src/Scopus/Search/AffiliationRetrieval.php +++ /dev/null @@ -1,55 +0,0 @@ - - * - * @version 2017-11-30 - * - * @since 2017-11-30 - */ - -namespace Scopus\Search; - -use Exception; - -/** - * AffiliationRetrieval Class - */ -class AffiliationRetrieval extends \Scopus\Scopus -{ - private $id; - private $url; - - public function __construct($id, $idType, $apiKey = null, $timeout = null) - { - parent::__construct($apiKey, $timeout); - $this->id = $id; - $this->getUrl($idType); - } - - private function getUrl($idType) - { - switch ($idType) { - case 'affiliationId': - $this->url = self::AFFILIATION_RETRIEVAL_AF_ID; - break; - case 'eid': - $this->url = self::AFFILIATION_RETRIEVAL_EID; - break; - default: - throw new Exception('Incorrect ID Type used. Must be one of the following: `affiliationId` or `eid`'); - } - } - - public function search() - { - $search = array_merge($this->httpAccept, $this->access_token, $this->insttoken, $this->reqId, $this->ver, - $this->view, $this->field, $this->start, $this->count, $this->startref, - $this->refcount); - - return $this->getJson($this->url.$this->id, $search); - } -} \ No newline at end of file diff --git a/src/Scopus/Search/AffiliationSearch.php b/src/Scopus/Search/AffiliationSearch.php deleted file mode 100644 index ec86854..0000000 --- a/src/Scopus/Search/AffiliationSearch.php +++ /dev/null @@ -1,34 +0,0 @@ - - * - * @version 2017-11-30 - * - * @since 2017-11-30 - */ - -namespace Scopus\Search; - -/** - * AffiliationSearch Class - */ -class AffiliationSearch extends \Scopus\Scopus -{ - public function __construct($apiKey = null, $timeout = null) - { - parent::__construct($apiKey, $timeout); - } - - public function search() - { - $search = array_merge($this->httpAccept, $this->access_token, $this->insttoken, $this->reqId, $this->ver, - $this->query, $this->view, $this->field, $this->suppressNavLinks, $this->start, - $this->count, $this->sort, $this->facets); - - return $this->getJson(self::AFFILIATION_SEARCH, $search); - } -} \ No newline at end of file diff --git a/src/Scopus/Search/AuthorRetrieval.php b/src/Scopus/Search/AuthorRetrieval.php deleted file mode 100644 index e40e3b5..0000000 --- a/src/Scopus/Search/AuthorRetrieval.php +++ /dev/null @@ -1,59 +0,0 @@ - - * - * @version 2017-11-29 - * - * @since 2017-11-29 - */ - -namespace Scopus\Search; - -/** - * AuthorRetrieval Class - */ -class AuthorRetrieval extends \Scopus\Scopus -{ - private $eid = []; - private $author_id = []; - private $self_citation = []; - - public function __construct($apiKey = null, $timeout = null) - { - parent::__construct($apiKey, $timeout); - } - - public function eid($eid) - { - $this->eid = ['eid' => $eid]; - - return $this; - } - - public function author_id($author_id) - { - $this->author_id = ['author_id' => $author_id]; - - return $this; - } - - public function self_citation($self_citation) - { - $this->self_citation = ['self-citation' => $self_citation]; - - return $this; - } - - public function search() - { - $search = array_merge($this->httpAccept, $this->access_token, $this->insttoken, $this->reqId, $this->ver, - $this->eid, $this->author_id, $this->self_citation; - - return $this->getJson(self::AUTHOR_RETRIEVAL, $search); - } -} -?> \ No newline at end of file diff --git a/src/Scopus/Search/AuthorSearch.php b/src/Scopus/Search/AuthorSearch.php deleted file mode 100644 index 739a841..0000000 --- a/src/Scopus/Search/AuthorSearch.php +++ /dev/null @@ -1,43 +0,0 @@ - - * - * @version 2017-11-29 - * - * @since 2017-11-29 - */ - -namespace Scopus\Search; - -/** - * AuthorSearch Class - */ -class AuthorSearch extends \Scopus\Scopus -{ - private $co_author = []; - - public function __construct($apiKey = null, $timeout = null) - { - parent::__construct($apiKey, $timeout); - } - - public function co_author($co_author) - { - $this->co_author = ['co-author' => $co_author]; - - return $this; - } - - public function search() - { - $search = array_merge($this->httpAccept, $this->access_token, $this->insttoken, $this->reqId, $this->ver, - $this->query, $this->co_author, $this->view, $this->field, $this->suppressNavLinks, - $this->start, $this->count, $this->sort, $this->facets, $this->alias); - - return $this->getJson(self::AUTHOR_SEARCH, $search); - } -} \ No newline at end of file diff --git a/src/Scopus/Search/CitationsCount.php b/src/Scopus/Search/CitationsCount.php deleted file mode 100644 index 89497ef..0000000 --- a/src/Scopus/Search/CitationsCount.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * @version 2017-11-30 - * - * @since 2017-11-30 - */ - -namespace Scopus\Search; - -/** - * CitationsCount Class - */ -class CitationsCount extends \Scopus\Scopus -{ - public function __construct($apiKey = null, $timeout = null) - { - parent::__construct($apiKey, $timeout); - } - - public function search() - { - $search = array_merge($this->httpAccept, $this->access_token, $this->insttoken, $this->reqId, $this->ver, - $this->scopus_id, $this->doi, $this->pii, $this->pubmed_id); - - return $this->getJson(self::CITATIONS_COUNT, $search); - } -} \ No newline at end of file diff --git a/src/Scopus/Search/CitationsOverview.php b/src/Scopus/Search/CitationsOverview.php deleted file mode 100644 index cb8caf9..0000000 --- a/src/Scopus/Search/CitationsOverview.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * @version 2017-11-30 - * - * @since 2017-11-30 - */ - -namespace Scopus\Search; - -/** - * CitationsOverview Class - */ -class CitationsOverview extends \Scopus\Scopus -{ - private $citation; - private $author_id; - - public function __construct($apiKey = null, $timeout = null) - { - parent::__construct($apiKey, $timeout); - } - - public function citation($citation) - { - $this->citation = ['citation' => $citation]; - - return $this; - } - - public function author_id($author_id) - { - $this->author_id = ['author_id' => $author_id]; - - return $this; - } - - public function search() - { - $search = array_merge($this->httpAccept, $this->access_token, $this->insttoken, $this->reqId, $this->ver, - $this->start, $this->count, $this->view, $this->field, $this->sort, $this->date, $this->citation, - $this->author_id, $this->scopus_id, $this->doi, $this->pii, $this->pubmed_id); - - return $this->getJson(self::CITATIONS_OVERVIEW, $search); - } -} \ No newline at end of file diff --git a/src/Scopus/Search/ScopusSearch.php b/src/Scopus/Search/ScopusSearch.php deleted file mode 100644 index bb4667a..0000000 --- a/src/Scopus/Search/ScopusSearch.php +++ /dev/null @@ -1,34 +0,0 @@ - - * - * @version 2017-11-30 - * - * @since 2017-11-30 - */ - -namespace Scopus\Search; - -/** - * ScopusSearch Class - */ -class ScopusSearch extends \Scopus\Scopus -{ - public function __construct($apiKey = null, $timeout = null) - { - parent::__construct($apiKey, $timeout); - } - - public function search() - { - $search = array_merge($this->httpAccept, $this->access_token, $this->insttoken, $this->reqId, $this->ver, - $this->query, $this->view, $this->field, $this->suppressNavLinks, $this->date, - $this->start, $this->count, $this->sort, $this->content, $this->subj, $this->alias, $this->facets); - - return $this->getJson(self::SCOPUS_SEARCH, $search); - } -} \ No newline at end of file diff --git a/src/Scopus/Search/SerialTitle.php b/src/Scopus/Search/SerialTitle.php deleted file mode 100644 index 411f349..0000000 --- a/src/Scopus/Search/SerialTitle.php +++ /dev/null @@ -1,80 +0,0 @@ - - * - * @version 2017-11-29 - * - * @since 2017-11-29 - */ - -namespace Scopus\Search; - -use Exception; - -/** - * SerialTitle Class - */ -class SerialTitle extends \Scopus\Scopus -{ - private $title = []; - private $issn = []; - private $pub = []; - private $oa = []; - - public function __construct($apiKey = null, $timeout = null) - { - parent::__construct($apiKey, $timeout); - } - - public function title($title) - { - $this->title = ['title' => $title]; - - return $this; - } - - public function issn($issn) - { - if ($this->isValidIssn($issn)) { - $this->issn = ['issn' => $issn]; - } else { - throw new Exception('The ISSN you entered is not valid.'); - } - - return $this; - } - - public function isValidIssn($issn) - { - $validate = new \Scopus\Validators\IssnValidator; - - return $validate->validate($issn); - } - - public function pub($pub) - { - $this->pub = ['pub' => $pub]; - - return $this; - } - - public function oa($oa) - { - $this->oa = ['oa' => $oa]; - - return $this; - } - - public function search() - { - $search = array_merge($this->httpAccept, $this->access_token, $this->insttoken, $this->reqId, $this->ver, - $this->start, $this->count, $this->view, $this->field, $this->title, - $this->issn, $this->pub, $this->subj, $this->content, $this->date, $this->oa); - - return $this->getJson(self::SERIAL_TITLE, $search); - } -} \ No newline at end of file diff --git a/src/Scopus/Search/SubjectClassifications.php b/src/Scopus/Search/SubjectClassifications.php deleted file mode 100644 index 677e8c1..0000000 --- a/src/Scopus/Search/SubjectClassifications.php +++ /dev/null @@ -1,93 +0,0 @@ - - * - * @version 2017-11-30 - * - * @since 2017-11-30 - */ - -namespace Scopus\Search; - -use Exception; - -/** - * SubjectClassifications Class - */ -class SubjectClassifications extends \Scopus\Scopus -{ - private $url; - - private $description; - private $detail; - private $code; - private $parentCode; - private $abbrev; - - public function __construct($searchType, $apiKey = null, $timeout = null) - { - parent::__construct($apiKey, $timeout); - $this->getUrl($searchType); - } - - private function getUrl($searchType) - { - switch ($searchType) { - case 'scidir': - $this->url = self::SUBJECT_CLASSIFICATIONS_SCIDIR; - break; - case 'scopus': - $this->url = self::SUBJECT_CLASSIFICATIONS_SCOPUS; - break; - default: - throw new Exception('Incorrect ID Type used. Must be one of the following: `scidir` or `scopus`'); - } - } - - public function description($description) - { - $this->description = ['description' => $description]; - - return $this; - } - - public function detail($detail) - { - $this->detail = ['detail' => $detail]; - - return $this; - } - - public function code($code) - { - $this->code = ['code' => $code]; - - return $this; - } - - public function parentCode($parentCode) - { - $this->parentCode = ['parentCode' => $parentCode]; - - return $this; - } - - public function abbrev($abbrev) - { - $this->abbrev = ['abbrev' => $abbrev]; - - return $this; - } - - public function search() - { - $search = array_merge($this->httpAccept, $this->description, $this->detail, $this->code, $this->parentCode, - $this->abbrev, $this->field); - - return $this->getJson($this->url, $search); - } -} \ No newline at end of file diff --git a/src/Scopus/ScopusSearch.php b/src/ScopusSearch.php similarity index 99% rename from src/Scopus/ScopusSearch.php rename to src/ScopusSearch.php index a5af242..22fd2d2 100644 --- a/src/Scopus/ScopusSearch.php +++ b/src/ScopusSearch.php @@ -31,4 +31,4 @@ public function search() return $this->getJson(self::SCOPUS_SEARCH, $search); } -} \ No newline at end of file +} diff --git a/src/Scopus/SerialTitle.php b/src/SerialTitle.php similarity index 86% rename from src/Scopus/SerialTitle.php rename to src/SerialTitle.php index 31b4533..80926ec 100644 --- a/src/Scopus/SerialTitle.php +++ b/src/SerialTitle.php @@ -6,7 +6,7 @@ * * @author Jared Howland * - * @version 2017-11-29 + * @version 2023-05-24 * * @since 2017-11-29 */ @@ -48,13 +48,6 @@ public function issn($issn) return $this; } - public function isValidIssn($issn) - { - $validate = new \Scopus\Validators\IssnValidator; - - return $validate->validate($issn); - } - public function pub($pub) { $this->pub = ['pub' => $pub]; @@ -71,10 +64,17 @@ public function oa($oa) public function search() { - $search = array_merge($this->httpAccept, $this->access_token, $this->insttoken, $this->reqId, $this->ver, + $search = array_merge($this->httpAccept, $this->access_token, $this->insttoken, $this->reqId, $this->ver, $this->start, $this->count, $this->view, $this->field, $this->title, - $this->issn, $this->pub, $this->subj, $this->content, $this->date, $this->oa); + $this->issn, $this->pub, $this->subj, $this->subjCode, $this->content, $this->date, $this->oa); return $this->getJson(self::SERIAL_TITLE, $search); } -} \ No newline at end of file + + private function isValidIssn($issn) + { + $validate = new \Scopus\Validators\IssnValidator; + + return $validate->validate($issn); + } +} diff --git a/src/Scopus/SubjectClassifications.php b/src/SubjectClassifications.php similarity index 99% rename from src/Scopus/SubjectClassifications.php rename to src/SubjectClassifications.php index 882fe4f..cf28036 100644 --- a/src/Scopus/SubjectClassifications.php +++ b/src/SubjectClassifications.php @@ -90,4 +90,4 @@ public function search() return $this->getJson($this->url, $search); } -} \ No newline at end of file +} diff --git a/src/Scopus/Validators/IsbnValidator.php b/src/Validators/IsbnValidator.php similarity index 100% rename from src/Scopus/Validators/IsbnValidator.php rename to src/Validators/IsbnValidator.php diff --git a/src/Scopus/Validators/IssnValidator.php b/src/Validators/IssnValidator.php similarity index 100% rename from src/Scopus/Validators/IssnValidator.php rename to src/Validators/IssnValidator.php diff --git a/src/Scopus/Validators/LICENSE.md b/src/Validators/LICENSE.md similarity index 100% rename from src/Scopus/Validators/LICENSE.md rename to src/Validators/LICENSE.md diff --git a/src/Scopus/Validators/Validator.php b/src/Validators/Validator.php similarity index 100% rename from src/Scopus/Validators/Validator.php rename to src/Validators/Validator.php