diff --git a/.github/workflows/ember.yml b/.github/workflows/ember.yml index 704457f..f323ca3 100644 --- a/.github/workflows/ember.yml +++ b/.github/workflows/ember.yml @@ -6,7 +6,7 @@ on: tags: - 'v*' pull_request: - branches: [ main, 'release/v*', 'dev-v*' ] + branches: [ main, 'release/v*', 'dev-v*', release/v*, dev-v* ] env: NODE_VERSION: 22.x diff --git a/.github/workflows/server.yml b/.github/workflows/server.yml index 83a4135..3ca6a4a 100644 --- a/.github/workflows/server.yml +++ b/.github/workflows/server.yml @@ -6,7 +6,7 @@ on: tags: - 'v*' pull_request: - branches: [ main, 'release/v*', 'dev-v*' ] + branches: [ main, 'release/v*', 'dev-v*', release/v*, dev-v* ] jobs: build: diff --git a/README.md b/README.md index ca9429d..4709c65 100644 --- a/README.md +++ b/README.md @@ -1,333 +1,282 @@ -

-

- -

-

- Solid Protocol Extension to Store and Share Data with Fleetbase -

-

-

- Repository - - - License: AGPL-3.0-or-later - - - Coverage - - - NPM package - - - Packagist package + Fleetbase Solid - Node >= 18 - PHP ^8.1

-# Introduction: - -Solid, an innovative technology developed by Sir Tim Berners-Lee, offers a groundbreaking approach to managing data by enabling decentralized data ownership and interoperability through Linked Data principles. In the realm of logistics, Solid presents a promising solution for revolutionizing supply chain management by facilitating seamless data sharing among stakeholders. This document outlines Solid's capabilities and requirements for implementing a logistics solution, along with a user needs assessment highlighting UI/UX changes necessary for optimal user experience. - -## Solid's Capabilities for Logistics: - -- **Decentralized Data Ownership:** Solid allows individual entities, such as companies and suppliers, to maintain ownership of their data while granting controlled access to authorized parties. This feature ensures data security and privacy, crucial aspects in logistics operations. - -- **Linked Data Sharing:** Solid's ability to establish a knowledge graph facilitates interconnectedness among disparate data sources. This is particularly beneficial for supply chain management, as it enables holistic insights and transparency across the entire supply chain network. - -- **Interoperability:** Solid promotes interoperability by standardizing data formats and protocols, enabling seamless communication and integration between different systems and platforms. This facilitates smooth data exchange between logistics partners and enhances operational efficiency. - -- **Collaborative Workflows:** With Solid, logistics stakeholders can collaborate in real-time, share updates, and coordinate activities effectively. This fosters greater synergy and coordination within the supply chain ecosystem, leading to improved decision-making and responsiveness. - -## Requirements for Logistics Solution on Solid: - -- **Solid Compatibility:** Fleetbase must be compatible with Solid's architecture, ensuring seamless integration and data exchange within the Solid ecosystem. - -- **Data Security and Privacy:** Robust mechanisms for data security and privacy protection must be implemented to safeguard sensitive logistics information shared through Solid. - -- **Linked Data Integration:** Fleetbase should leverage Solid's linked data capabilities to establish a comprehensive knowledge graph that connects relevant supply chain data points, enabling advanced analytics and insights generation. - -- **Interoperability Standards:** Adherence to interoperability standards and protocols endorsed by Solid is essential to ensure compatibility and smooth interoperability with other logistics systems and platforms. - -- **User-Friendly Interface:** The solution should feature an intuitive user interface (UI) that simplifies data interaction and facilitates seamless navigation for logistics professionals across different roles and responsibilities. - -## Project Milestones: - -1. **Research and planning - Milestone 1** - -2. **Back End Development - Solid Server, Solid Auth, Create Pods - Milestone 2** - -3. **Back End Development - Pod for instance or Pod for Organization - Milestone 3** - -4. **User Interface (UI) Enhancement - Manage Pod In Admin - Milestone 4** - -5. **Further User Interface (UI) Enhancement - Milestone 5** +

Fleetbase Solid

-## User Needs Assessment: UI/UX Changes: - -### Prerequisites: - -- **Create Pod on Solid:** Begin by registering on Solid via [solidcommunity.net](https://solidcommunity.net). -- **Retrieve Web ID:** Obtain your Web ID from example: [shivthakker.solidcommunity.net](https://shivthakker.solidcommunity.net). -- **Ability to create pod using Fleetbase directly.** - -### Installation and Setup: - -- Install the ‘Solid Extension’ from Fleetbase Extensions Marketplace, accessible at the Instance Level. -- Add ‘Install Solid’ functionality within Fleetbase Extensions Tab. -- Create pod & server -- Input their server -- Input their solid ID on the server -- Once installed, users signing up or added to the company within this instance can utilize Solid for data management. -- More info: The interface which allows the instance administrator to link the Fleetbase Solid extension to the Solid server of their preference. Due to the nature of how Solid is built on an identity basis, and Fleetbase is built as a multi-tenant platform. Each organization on Fleetbase when accessing the instance will be prompted to link their Solid OIDC account [https://github.com/fleetbase/solid/blob/main/addon/controllers/application.js#L16] to their Fleetbase organization per the instance. Once linked all data synced between Solid and Fleetbase will be via the SolidIdentity [https://github.com/fleetbase/solid/blob/main/server/src/Models/SolidIdentity.php] - -### User Authentication and Account Creation: - -- Choose data storage preference: Browser Storage or Solid. -- Log in or sign up with your Solid Web ID. -- Authorize fleetbase.io to access your Pod. -- Solid allows precise control over data access permissions. Note: The current UI version (node-solid-server V5.1) supports toggling global access permissions only. If you prefer granular control, uncheck all boxes and authorize. Then, manage permissions explicitly. - -### Fleetbase UI Updates - -Developer/User Guide: - -Fleetbase Solid ExtensionThis guide provides detailed instructions for integrating the Solid extension with your Fleetbase account. Solid is an innovative technology that lets users store their own data in personal online data stores, called "Pods," that they control. By using the Solid extension on Fleetbase, users can manage their data directly through the Fleetbase interface. - -1. Create a New Fleetbase Account -- If you don't already have a Fleetbase account, you'll need to create one: - -- Go to the Fleetbase website -- Click on "Sign Up" and follow the registration process. -- Verify your account as required. - -![image](https://github.com/fleetbase/solid/assets/58805033/8dd8084c-5007-420e-b235-b46848cbe884) - -2. Install the Solid Extension -- Once your Fleetbase account is active, follow these steps to install the Solid extension: - -- Log in to your Fleetbase dashboard.Navigate to the Extensions section. -- Find the Solid extension and click "Install."Fleetbase Extensions Registry will be launching Q3 2024 - -3. Admin Configuration -- As an admin, you need to set up the Solid server for your organization: - -- After installation, navigate to Admin so you can configure the Solid extension settings. -- Input the Solid server ID where your organization's data will be stored. This might be a private server or a service like solidcommunity.net +

+ Solid Protocol extension to store and share Fleetbase data in Solid pods. +

-![image](https://github.com/fleetbase/solid/assets/58805033/a9324b10-f963-4a41-89c8-9ed574b450b5) +

+ License: AGPL-3.0-or-later + PHP CI + Ember CI + Coverage + npm version + PHP ^8.2 + Node 22.x +

+## Overview -4. Get Started with Solid -- Users must individually sign up for a Solid account: +[Solid](https://solidproject.org) is a specification, led by Sir Tim Berners-Lee, in which people and organizations keep their data in online data stores ("pods") that they control, and grant applications access to it through a WebID and Solid-OIDC. Data in a pod is Linked Data (RDF), so any Solid-compatible application can read it rather than it being locked into one platform. -- Click ‘Sign up for an account’ or Visit https://solidcommunity.net/register or your organization's own Solid server. -- Complete the registration process to create a new Solid account. +This extension connects Fleetbase to a Solid server. Each Fleetbase user links a Solid WebID to their Fleetbase organization, browses and manages the contents of their pod from the Fleetbase console, and exports Fleet-Ops records (vehicles, drivers, contacts, and orders) into the pod as Turtle documents. -![image](https://github.com/fleetbase/solid/assets/58805033/2bbc7406-ae08-4500-afb0-b52af675110b) +Solid ships as both a Laravel package and an Ember engine. The backend package provides the Solid client, the Solid-OIDC handshake, the pod and ACL services, the Fleet-Ops export, routes, and migrations. The frontend engine provides the Solid console screens and the admin server configuration panel. -5.​​ Retrieve Your Web ID -- Your Web ID is your unique identifier in the Solid ecosystem: +## Contents -- After registering, your Web ID will typically be displayed on your Solid dashboard.Note this Web ID as it will be used to link your Solid account with Fleetbase. +- [Features](#features) +- [Architecture](#architecture) +- [Requirements](#requirements) +- [Installation](#installation) +- [Configuration](#configuration) +- [Development](#development) +- [Documentation](#documentation) +- [Contributing](#contributing) +- [Security](#security) +- [Funding](#funding) +- [License](#license) -![image](https://github.com/fleetbase/solid/assets/58805033/1ef66dfd-fe19-4795-b1bf-3d16ba7e65f8) +## Features -6.​​ Navigate to ‘Account’ in Fleetbase -- Once your Web ID is set up:Go back to Fleetbase and navigate to the ‘Account’ section. Your User details should be pulled in automatically if properly configured. +### Solid identity -![image](https://github.com/fleetbase/solid/assets/58805033/4d3d3090-1e3e-49e6-babc-f1c3db205080) +- Link a Fleetbase user and organization to a Solid WebID through the Solid-OIDC authorization code flow. +- Connection status, WebID, and profile details read from the user's Solid profile document. +- Sign out of Solid, which clears the stored tokens and the dynamic client registration. +- One Solid identity per user per organization, stored in the `solid_identities` table. -7.​​ Navigate to PodsTo manage your Pods: - - In Fleetbase, find and navigate to the ‘Pods’ section after linking your Solid account. +### Pod data -![image](https://github.com/fleetbase/solid/assets/58805033/bcc83875-e4ed-4ae1-be83-6044eefe323e) +- Browse the root of the user's pod and open folders (LDP containers). +- Create folders with the Solid Protocol `POST` and `Slug` header. +- Delete files and folders. +- Web Access Control (WAC) checks before writing. When the requested location is not writable, the response lists the writable storage locations from the user's profile. -8.​​ Create a New POD -- Here’s how to create a new POD: +### Fleet-Ops export -- Click “Create New POD.”Enter a name for your POD and submit. +- Import Fleet-Ops vehicles, drivers, contacts, and orders for the current organization into the pod. +- Each record is written as a Turtle document at `//.ttl`, using the `http://fleetbase.io/ns/` vocabulary, inside a container created for each resource type. +- Up to 100 records per resource type per import. -![image](https://github.com/fleetbase/solid/assets/58805033/2677491c-7de3-4592-9f30-80448e818ff6) +### Administration -9.​​ Manage Files/Folders in PODs -- To access and manage data within a POD: +- A **Solid Protocol > Solid Server Config** panel in the Fleetbase admin to set the Solid server host, port, and TLS. It is saved as a system setting and overrides the environment defaults. +- A **Solid** item in the console header that opens the extension. -- Click into the POD you wish to view. -- You’ll see files and folders stored in this POD +## Architecture -![image](https://github.com/fleetbase/solid/assets/58805033/e04e151a-d640-4e29-a91a-a6f09347e59d) +Solid is split into two distributable packages: -10. Operations on PODsSelect +| Package | Runtime | Description | +| --- | --- | --- | +| `fleetbase/solid-api` | Laravel / PHP | Solid client, Solid-OIDC handshake, `SolidIdentity` model, pod, ACL and resource sync services, routes, and migrations. | +| [`@fleetbase/solid-engine`](https://www.npmjs.com/package/@fleetbase/solid-engine) | Ember | Fleetbase console engine for the Solid home, account, and data screens, and the admin server configuration panel. | -- Box Delete: To delete files or folders, select them and use the delete option. -- Re-sync / Back Up the PODs: To ensure your data is up-to-date, use the re-sync option to resynchronize the data in the POD. +`SolidServiceProvider` requires both `fleetbase/core-api` and `fleetbase/fleetops-api` and will not load without them. -![image](https://github.com/fleetbase/solid/assets/58805033/1f5ef3a8-bed8-476b-b176-cdd19b6212cd) +### Backend -11. View Data in Pods -- To view specific data within a POD: +| Path | Purpose | +| --- | --- | +| `server/src/Client/SolidClient.php` | HTTP client for the Solid server. Resolves the server from the admin setting first, then `config('solid.server')`, and sends authenticated requests for a `SolidIdentity`. | +| `server/src/Client/OpenIDConnectClient.php`, `server/src/Auth/` | Solid-OIDC relying party: provider discovery, dynamic client registration, PKCE, DPoP-bound tokens, and ID token verification against the provider's JWKS. | +| `server/src/Models/SolidIdentity.php` | Links a user and company to a Solid identity and holds the token response and the verified ID token claims. | +| `server/src/Services/PodService.php` | Profile parsing, pod URL resolution from the WebID, container listing, folder creation, and deletion. | +| `server/src/Services/AclService.php` | WAC checks and ACL document generation for the pod and its folders. | +| `server/src/Services/ResourceSyncService.php` | Converts Fleet-Ops records to Turtle and writes them to the pod. | +| `server/config/solid.php` | Solid server and Solid-OIDC settings. | +| `server/migrations/` | The `solid_identities` table. | + +Backend routes are mounted under the `solid` prefix with the internal prefix `int`. + +| Route | Authentication | Purpose | +| --- | --- | --- | +| `GET /solid/int/v1/authenticate/{identifier}` | Public | Starts the Solid-OIDC flow and redirects to the identity provider. | +| `ANY /solid/int/v1/oidc/complete-registration/{identifier}` | Public | Authorization callback. Exchanges the code for tokens and redirects back to the console. | +| `GET /solid/int/v1/request-authentication`, `GET /solid/int/v1/authentication-status`, `POST /solid/int/v1/logout` | Fleetbase session | Begin sign-in, read connection status, and sign out. | +| `GET /solid/int/v1/account` | Fleetbase session | The Solid server's account index for the current identity. | +| `GET /solid/int/v1/data`, `GET /solid/int/v1/data/folder/{slug}` | Fleetbase session | Pod root and folder contents. | +| `POST /solid/int/v1/data/folder`, `DELETE /solid/int/v1/data/{type}/{slug}` | Fleetbase session | Create a folder; delete a file or folder. | +| `POST /solid/int/v1/data/import` | Fleetbase session | Import Fleet-Ops resources (`vehicles`, `drivers`, `contacts`, `orders`) into the pod. | +| `GET /solid/int/v1/server-config`, `POST /solid/int/v1/server-config` | Fleetbase admin | Read and save the Solid server configuration. | -- Simply click on the file or folder you are interested in within the POD interface in Fleetbase. +### Frontend -![image](https://github.com/fleetbase/solid/assets/58805033/55f8af9b-f82b-406d-9434-50404c282740) +The Ember engine mounts at the Fleetbase extension route `solid-protocol` and provides these routes: -Next: We will continue work on completing the Sold <> Fleetbase integration with the following Further User Interface (UI) Enhancement for renaming Pods. Extensive User testing / bug fixes and production release. +| Route | Purpose | +| --- | --- | +| `home` | Getting started, connection status, and **Connect to Solid**. | +| `account` | The user's account details alongside the Solid identity. | +| `data` | The pod root, with **New Folder** and **Import Resources**. | +| `data/content` | The contents of a folder in the pod. | -### Features: +## Requirements -Fleetbase has implemented a Solid Client which implements the Standard Solid authentication methods to communicate with the server. The Fleetbase SolidClient is able to communicate securely with the Solid protocol using the Standard DPoP encryption method for authentication provided by the Solid specification (https://solidproject.org/TR/oidc#tokens-id) +- PHP `^8.2` with the `json` and `openssl` extensions +- Composer +- Fleetbase Core API `^2.0` (`fleetbase/core-api`) +- Fleetbase Fleet-Ops API `^0.7.0` (`fleetbase/fleetops-api`) +- The Laravel 12 Fleetbase API (fleetbase/fleetbase v0.8.0 or later) +- Redis, which holds in-flight Solid-OIDC authorization state +- A Solid server that supports Solid-OIDC, such as the Community Solid Server +- Node.js 22.x +- pnpm -- Ability to link Fleetbase account with Solid Web ID later via user settings. +Laravel 10 installations stay on the v0.0.8 line of this extension. -#### Solid-OIDC implementation +## Installation -The relying-party handshake lives in `server/src/Client/OpenIDConnectClient.php` and -`server/src/Auth/`, with no third-party OIDC library. Solid-OIDC needs three things a -general-purpose OAuth client does not provide — RFC 7591 dynamic client registration, -RFC 9449 DPoP-bound tokens, and an issuer discovered per tenant at runtime — so the -extension owns that code rather than wrapping a library around it. ID token -verification follows the same conventions as Core API's `Fleetbase\Auth\OAuth\IdTokenVerifier`: -a short-lived JWKS cache, resolution by `kid`, one forced refetch when a token names an -unknown key, and TLS verification that is never inferred from the app environment. +Install Solid from the Extensions section of the Fleetbase console, then run migrations through your normal Fleetbase deployment flow: -What the handshake checks on the authorization callback: the `state` (single use, server -side), the ID token's signature against the provider's published JWKS, its `iss`, `aud` -and `azp`, its expiry, its `nonce`, and that the access token is bound to the DPoP key -this identity holds. +```bash +php artisan migrate +``` -Everything is configured under the `oidc` key of `server/config/solid.php`. The one -setting a local development environment usually needs is `SOLID_OIDC_VERIFY_TLS=false`, -for a Solid server with a self-signed certificate. +For package-level installation of the Ember engine: -# Funding +```bash +pnpm install @fleetbase/solid-engine +``` -This project is funded through [NGI0 Entrust](https://nlnet.nl/entrust), a fund established by [NLnet](https://nlnet.nl) with financial support from the European Commission's [Next Generation Internet](https://ngi.eu) program. Learn more at the [NLnet project page]( https://nlnet.nl/project/Fleetbase-Solid). +The backend package is `fleetbase/solid-api`. -[NLnet foundation logo](https://nlnet.nl) +After installation: -# Conclusion: +1. Open **Admin > Solid Protocol > Solid Server Config** and set the host, port, and TLS setting of your Solid server. +2. Open **Solid** from the console header and choose **Connect to Solid** to link your WebID. -Solid offers a robust foundation for developing innovative logistics solutions that prioritize data ownership, interoperability, and collaboration. By leveraging Solid's capabilities and addressing specific user needs through UI/UX enhancements, logistics stakeholders can unlock new levels of efficiency, transparency, and value creation in supply chain management. +## Configuration -This document serves as a roadmap for designing and implementing Solid on Fleetbase, guiding stakeholders towards harnessing the full potential of decentralized, linked data sharing in the logistics domain. +Solid reads its defaults from `server/config/solid.php`. The Solid server settings can be overridden per instance from the admin panel. The Solid-OIDC settings are read only from the environment. +| Variable | Default | Purpose | +| --- | --- | --- | +| `SOLID_HOST` | `http://solid` | Solid server host. | +| `SOLID_PORT` | `3000` | Solid server port. | +| `SOLID_SECURE` | `false` | Use HTTPS for the Solid server. | +| `SOLID_OIDC_ISSUER` | The Solid server URL | Where to fetch `.well-known/openid-configuration` from, when the identity provider is reached at a different address than the data API. | +| `SOLID_OIDC_VERIFY_TLS` | `true`, unless `APP_ENV` is `local` or `development` | TLS verification for discovery, registration, token, and JWKS requests. Set it to `false` only for a development Solid server with a self-signed certificate. | +| `SOLID_OIDC_STATE_TTL` | `600` | Seconds an in-flight authorization request stays valid. | +| `SOLID_OIDC_CLIENT_CREDENTIALS_TTL` | `0` | Seconds a dynamic client registration is kept. `0` keeps it until sign-out. | +| `SOLID_OIDC_JWKS_CACHE_TTL` | `300` | Seconds the provider's JWKS is cached. | +| `SOLID_OIDC_DISCOVERY_CACHE_TTL` | `300` | Seconds the provider's discovery document is cached. | +| `SOLID_OIDC_LEEWAY` | `60` | Clock skew, in seconds, allowed on ID token `exp`, `iat`, and `nbf`. | +| `SOLID_OIDC_REQUIRE_NONCE` | `true` | Reject an ID token that does not echo the request nonce. | +| `SOLID_OIDC_TIMEOUT` | `15` | Timeout, in seconds, for Solid-OIDC HTTP requests. | +| `SOLID_OIDC_KEY_DISK` | `local` | Filesystem disk that holds each identity's DPoP private key. It must not be reachable from the internet. | ---- +## Development -## Overview +### Fleetbase workspace linking -This monorepo contains both the frontend and backend components of the Solid Protocol integration extension for Fleetbase. The frontend is built using Ember.js and the backend is implemented in PHP. +When working on Solid inside a full Fleetbase checkout, use Fleetbase's package linker from the repository root instead of hand-editing `console/package.json`, `api/composer.json`, or `console/pnpm-workspace.yaml`. -### Requirements +Install the linker once from the Fleetbase repository root: -* PHP 7.3.0 or above -* Ember.js v4.8 or above -* Ember CLI v4.8 or above -* Node.js v18 or above +```bash +npm link +``` -## Structure +Enable Solid as a local development package, with this repository checked out at `packages/solid`: -``` -├── addon -├── app -├── assets -├── translations -├── config -├── node_modules -├── server -│ ├── config -│ ├── data -│ ├── migrations -│ ├── resources -│ ├── src -│ ├── tests -│ └── vendor -├── tests -├── testem.js -├── index.js -├── package.json -├── phpstan.neon.dist -├── phpunit.xml.dist -├── pnpm-lock.yaml -├── ember-cli-build.js -├── composer.json -├── CONTRIBUTING.md -├── LICENSE.md -├── README.md +```bash +flb-package-linker enable solid +flb-package-linker install solid ``` -## Installation +Use `--install` to let the linker run the required package-manager commands immediately: -### Backend +```bash +flb-package-linker enable solid --install +``` -Install the PHP packages using Composer: +Check link state with: ```bash -composer require fleetbase/core-api -composer require fleetbase/fleetops -composer require fleetbase/solid-api +flb-package-linker status +flb-package-linker doctor ``` -### Frontend -Install the Ember.js Engine/Addon: +See the [Fleetbase development setup guide](https://www.fleetbase.io/docs/platform/quickstart/development-setup) for Docker mounts, local Ember dev server setup, package-linker details, and unlink/reset commands. Fleetbase runs Laravel Octane, so reload the API worker after PHP changes: ```bash -pnpm install @fleetbase/solid-engine +docker compose exec application php artisan octane:reload ``` -## Usage +### Package-level development -### Backend +Install dependencies: -🧹 Keep a modern codebase with **PHP CS Fixer**: ```bash -composer lint +composer install +pnpm install ``` -⚗️ Run static analysis using **PHPStan**: -```bash -composer test:types -``` +Composer installs into `server_vendor/` rather than `vendor/`. -✅ Run unit tests using **PEST** -```bash -composer test:unit -``` +Run the Ember engine locally: -🚀 Run the entire test suite: ```bash -composer test +pnpm start ``` -### Frontend +Frontend checks: -🧹 Keep a modern codebase with **ESLint**: ```bash pnpm lint -``` - -✅ Run unit tests using **Ember/QUnit** -```bash pnpm test pnpm test:ember -pnpm test:ember-compatibility +pnpm build ``` -🚀 Start the Ember Addon/Engine +Backend checks: + ```bash -pnpm start +composer test:lint +composer test:types +composer test:unit +composer test ``` -🔨 Build the Ember Addon/Engine +`composer test` runs the PHP CS Fixer dry run, PHPStan, and the Pest suite. `composer lint` runs PHP CS Fixer in fix mode and rewrites files. + +Coverage: + ```bash -pnpm build +composer test:coverage +composer coverage:baseline ``` +## Documentation + +- [Fleetbase documentation](https://www.fleetbase.io/docs) +- [Fleetbase development setup](https://www.fleetbase.io/docs/platform/quickstart/development-setup) +- [Solid Project](https://solidproject.org) +- [Release notes](RELEASE.md) + ## Contributing -See the Contributing Guide for details on how to contribute to this project. + +Contributions are welcome. Please read the [contributing guide](CONTRIBUTING.md) before opening a pull request. + +For local changes, keep frontend and backend checks focused on the area you touched and include relevant test output in your pull request. + +## Security + +Please do not report security issues in public GitHub issues. Contact Fleetbase at [hello@fleetbase.io](mailto:hello@fleetbase.io) with details so the team can coordinate a responsible fix. + +## Funding + +This project is funded through [NGI0 Entrust](https://nlnet.nl/entrust), a fund established by [NLnet](https://nlnet.nl) with financial support from the European Commission's [Next Generation Internet](https://ngi.eu) program. Learn more at the [NLnet project page](https://nlnet.nl/project/Fleetbase-Solid). + +[NLnet foundation logo](https://nlnet.nl) ## License -This project is licensed under the MIT License. + +Fleetbase Solid is open-source software licensed under the [AGPL-3.0-or-later](LICENSE.md). diff --git a/RELEASE.md b/RELEASE.md index 8186ebe..daaed86 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -1,75 +1,14 @@ -> v0.0.8 ~ "Solid-OIDC brought in-house, and a verified authorization callback" +> v0.1.0 ~ "Laravel 12 and core-api 2.0" --- ## Highlights -Solid can be installed alongside current Core API again. `jumbojett/openid-connect-php` pinned `phpseclib/phpseclib ^3.0.7`, and Core API's `laravel/socialite ^5.31` requires `^4.0`, so the two could not coexist — Composer refused to resolve the application at all. Upstream Jumbojett has not migrated to phpseclib 4, and phpseclib 4 renamed its root namespace, so widening the constraint would resolve and then fail at runtime. - -The dependency turned out to be carrying that pin for code Solid never ran. Jumbojett touches phpseclib in one method, RSA signature verification, which this extension already overrode — and the authorization callback never reached Jumbojett's verification at all. Roughly 150 lines of a 2,100-line library were in use, with transport, token requests, client registration, session storage and discovery all replaced locally. - -So the library is gone and the Solid-OIDC client lives in the extension, in `server/src/Client/OpenIDConnectClient.php` and `server/src/Auth/`. Solid-OIDC needs three things no general-purpose OAuth client provides — RFC 7591 dynamic client registration, RFC 9449 DPoP-bound tokens, and an issuer discovered per tenant at runtime — and all three were already written here. ID token verification follows the conventions of Core API's `Fleetbase\Auth\OAuth\IdTokenVerifier`. - -Closing that out fixed a set of real gaps in the handshake, described below. **No user has to sign in again:** existing client registrations are reused and existing DPoP keys are migrated rather than regenerated. - ---- -## Security - -The authorization callback now verifies what it receives. Previously it exchanged whatever code it was handed, and the WebID that drives every pod read and write was taken from an unverified JWT. - -- **ID token verification.** Signature checked against the provider's published JWKS, plus `iss` (exact), `aud`, `azp` when `aud` is multi-valued, expiry with a bounded 60-second leeway, `nonce`, and the presence of `sub`. None of these were checked before. -- **`state` validation.** Server-side, single use, consumed before comparison so a rejected callback cannot be retried, and a mismatch now voids the whole pending request. `state` was previously ignored entirely. -- **DPoP private keys are no longer web-reachable.** They were written with a bare `Storage::put()`, and the application's default disk is `public` — rooted at `storage/app/public`, symlinked to `public/storage` and served over HTTP — or an S3/GCS bucket. Keys now go to an explicitly named private disk (`solid.oidc.key_disk`, default `local`), and a key found in the old location is moved there and the exposed copy deleted. -- **Algorithm confusion.** A key without an `alg` is dropped rather than assumed to be RS256, and a token whose header algorithm differs from its key's is rejected, so `alg: none` and HS256-signed-with-the-RSA-public-key both fail. -- **PKCE** is mandatory and fails loudly if the provider advertises methods that exclude S256, instead of silently dropping the challenge. -- **TLS verification** is one explicit flag, `solid.oidc.verify_tls`, rather than inferred from `APP_ENV` — which also disabled it in any environment an operator happened to name `local` or `development`. Local development against a self-signed certificate is unchanged by default; set `SOLID_OIDC_VERIFY_TLS=false` to say so explicitly. -- **Redirects are no longer followed** on OIDC requests. The old transport set `CURLOPT_FOLLOWLOCATION`, which could replay an `Authorization: Basic` client secret against whatever host a `Location` header named. -- **Tokens are out of the logs.** The Solid client was logging the decoded access-token payload and then the whole header set, including `Authorization: DPoP ` and the DPoP proof. -- **`state`, `nonce` and the PKCE verifier now expire.** They were written to Redis with no TTL, so an abandoned sign-in left them readable indefinitely. -- The access token's `cnf.jkt` is checked against the DPoP key held for the identity, so a token bound to a different key fails at sign-in rather than on every subsequent request. - ---- -## Fixes - -- DPoP `htu` strips the query and fragment, as RFC 9449 §4.2 requires. A proof built for a URL with parameters was unusable against a server that compares `htu` strictly. -- RFC 9449 §8 `use_dpop_nonce` is honoured: the token request is retried once with the nonce the provider asks for. -- Provider discovery is cached, per process and in the application cache. Every Solid request built a fresh client and refetched `.well-known/openid-configuration`, so a single controller action touching four resources made four extra round trips. -- The authorization callback reports a provider `error` instead of turning it into "missing authorization code". -- `authenticate()` returns a redirect response rather than calling `header()` and `exit`, so the redirect goes through the framework. -- Dynamic client registration declares `grant_types` including `refresh_token`. Without it a provider defaults to `authorization_code` alone, which made the requested `offline_access` scope unusable. Existing registrations are untouched; this applies to new ones. -- Requested scopes are deduplicated — the authorization request was sending `openid webid offline_access openid`. -- `firebase/php-jwt` is declared. It was already in use but relied on arriving transitively. - ---- -## Dependencies - -- Removed: `jumbojett/openid-connect-php`, all seven `web-token/jwt-*` packages, `php-http/guzzle7-adapter`, `psr/http-factory-implementation`. The `web-token` stack and the PSR adapters it needed had no references anywhere in the extension. -- Added: `firebase/php-jwt ^6.10|^7.0` (shared with Socialite rather than duplicating a JWT stack), `ext-json`, `ext-openssl`. -- `php` raised from `^8.0` to `^8.1`, matching Core API and phpseclib 4. -- Engine dependencies moved to their latest releases: `@fleetbase/ember-core` `^0.3.24`, `@fleetbase/ember-ui` `^0.4.3`, `@fleetbase/fleetops-data` `^0.2.2`. CI builds on Node 22. - ---- -## Also fixed - -Four defects that predate this release, found while auditing the OIDC code: - -- **`PodService` resolved a class that does not exist.** The commit that removed the CSS-credential approach in favour of OIDC tokens deleted `CssAccountService` but left two `app(CssAccountService::class)` call sites behind, so pod creation and the pod listing threw on entry. Those branches are removed, finishing that change. -- **`getAccountIndex()` ended in `dd()`** on the live `GET solid/int/v1/account` route, halting the request and dumping the raw pod response. It returns JSON now. Seven more routes pointed at controller methods that do not exist (`play`, `getProfileData` and the five `sync-*` actions) and would 500 on hit; nothing calls them, so they are removed. Every routed method now resolves. -- **The admin server-configuration UI had no effect.** `saveServerConfig()` wrote `system.solid.server` and `SolidClient` never read it, so changing the Solid host or port in the console changed nothing. Resolution is now explicit option → saved setting → config default. Two bugs in the same lines went with it: a caller-supplied host was silently discarded, and `new SolidClient([])` raised a `TypeError`. -- **`composer test` failed in all three stages.** It passes now: `test:unit` is back on Pest through a runner that works around the package's custom `vendor-dir`, `test:types` is clean at phpstan `level: max` against a committed baseline, and the six long-unformatted files are formatted. CI enforces all three, and `Run Lint` is now the dry-run form — it previously ran php-cs-fixer in *fix* mode, so it could never fail. - -Coverage is now generated, uploaded to Codecov and shown as a README badge: 25.45% overall, with the code added here at 81–100%. - ---- -## Tests - -The suite went from one placeholder test to **108 tests / 208 assertions**, covering ID token verification and its failure modes, the full authorization and callback flow, `state` and `nonce` handling, DPoP proof structure and key storage, JWKS caching and rotation, and dynamic client registration. Verified on PHP 8.2 and 8.4. - -The suite had been disabled in CI because Pest's binary resolves its autoloader from a hardcoded `vendor/`, which this package does not have — it sets `vendor-dir` to `server_vendor` — so `pest` could not start here at all. `composer test:unit` now goes through `scripts/pest-runner.php`, adopted from storefront, which bridges that for the duration of the run. CI runs the tests again, plus static analysis, lint and coverage. +- **Laravel 12.** The server package now runs on Laravel 12 with Carbon 3 and requires `fleetbase/core-api` ^2.0. It installs into the Laravel 12 Fleetbase API (fleetbase/fleetbase v0.8.0); Laravel 10 installs stay on the v0.0.8 line. +- **No security advisory exceptions.** `composer audit` reports no advisories on the Laravel 12 dependency set, so the Composer advisory workarounds are gone. --- ## Upgrading -- Root `composer.json`: `"fleetbase/solid-api": "^0.0.8"`. A `^0.0.7` constraint will not pick this up. -- `exchangeCodeForTokens($code, $state)` now requires the `state` from the callback. The signature is unchanged, but a missing one throws — without it there is no CSRF control on the callback. -- `Jumbojett\OpenIDConnectClientException` is replaced by `Fleetbase\Solid\Exceptions\OpenIDConnectClientException`, same name and same `\Exception` parent. -- If `FILESYSTEM_DRIVER` points at S3 or GCS, check that bucket for existing `solid/dpop_keys_*.json` objects and delete them. The automatic migration only covers the disk the application is currently configured with. +- **Requires fleetbase/core-api v2.0.0** (Laravel 12, PHP 8.2 or later). Upgrade the API to fleetbase/fleetbase v0.8.0 first, then this extension. +- **Requires** `fleetbase/fleetops-api` ^0.7.0. Install those Laravel 12 releases first. +- Run `php artisan migrate` after upgrading. diff --git a/composer.json b/composer.json index 190465a..7e7d4ab 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "fleetbase/solid-api", - "version": "0.0.8", + "version": "0.1.0", "description": "Solid Protocol Extension to Store and Share Data with Fleetbase", "keywords": [ "fleetbase-extension", @@ -27,21 +27,21 @@ } ], "require": { - "php": "^8.1", + "php": "^8.2", "ext-json": "*", "ext-openssl": "*", "easyrdf/easyrdf": "^1.1", "firebase/php-jwt": "^6.10|^7.0", - "fleetbase/core-api": "*", - "fleetbase/fleetops-api": "*", + "fleetbase/core-api": "^2.0", + "fleetbase/fleetops-api": "^0.7.0", "ml/json-ld": "^1.2" }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.34.1", - "nunomaduro/collision": "^7.0", - "pestphp/pest": "^2.33.2", - "phpstan/phpstan": "^1.10.38", - "symfony/var-dumper": "^5.4.29" + "nunomaduro/collision": "^8.0", + "pestphp/pest": "^3.0", + "phpstan/phpstan": "^2.0", + "symfony/var-dumper": "^7.0" }, "autoload": { "psr-4": { diff --git a/extension.json b/extension.json index 63a001c..b18c0ac 100644 --- a/extension.json +++ b/extension.json @@ -1,6 +1,6 @@ { "name": "Solid", - "version": "0.0.8", + "version": "0.1.0", "description": "Solid Protocol Extension to Store and Share Data with Fleetbase", "repository": "https://github.com/fleetbase/solid", "license": "AGPL-3.0-or-later", diff --git a/package.json b/package.json index e8e693f..43d31a6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@fleetbase/solid-engine", - "version": "0.0.8", + "version": "0.1.0", "description": "Solid Protocol Extension to Store and Share Data with Fleetbase", "fleetbase": { "route": "solid-protocol" diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 7295376..dc6de45 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1,816 +1,1795 @@ parameters: ignoreErrors: - - message: "#^Call to an undefined static method Illuminate\\\\Support\\\\Facades\\\\Redis\\:\\:del\\(\\)\\.$#" + message: '#^Method Fleetbase\\Solid\\Auth\\CachedJwksResolver\:\:resolve\(\) should return array\ but returns array\\.$#' + identifier: return.type count: 1 - path: server/src/Auth/RedisStateStore.php + path: server/src/Auth/CachedJwksResolver.php - - message: "#^Call to an undefined static method Illuminate\\\\Support\\\\Facades\\\\Redis\\:\\:get\\(\\)\\.$#" + message: '#^Method Fleetbase\\Solid\\Auth\\Contracts\\OidcResponse\:\:array\(\) should return array\ but returns array\\.$#' + identifier: return.type count: 1 - path: server/src/Auth/RedisStateStore.php + path: server/src/Auth/Contracts/OidcResponse.php - - message: "#^Call to an undefined static method Illuminate\\\\Support\\\\Facades\\\\Redis\\:\\:set\\(\\)\\.$#" + message: '#^Cannot access offset ''e'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible count: 1 - path: server/src/Auth/RedisStateStore.php + path: server/src/Auth/DPoPKeyPair.php - - message: "#^Call to an undefined static method Illuminate\\\\Support\\\\Facades\\\\Redis\\:\\:setex\\(\\)\\.$#" + message: '#^Cannot access offset ''n'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible count: 1 - path: server/src/Auth/RedisStateStore.php + path: server/src/Auth/DPoPKeyPair.php - - message: "#^Access to an undefined property Fleetbase\\\\Solid\\\\Models\\\\SolidIdentity\\:\\:\\$uuid\\.$#" + message: '#^Cannot cast mixed to string\.$#' + identifier: cast.string + count: 6 + path: server/src/Auth/DPoPKeyPair.php + + - + message: '#^Parameter \#1 \$privateKeyPem of class Fleetbase\\Solid\\Auth\\DPoPKeyPair constructor expects string, mixed given\.$#' + identifier: argument.type + count: 1 + path: server/src/Auth/DPoPKeyPair.php + + - + message: '#^Parameter \#1 \$value of static method Fleetbase\\Solid\\Auth\\DPoPKeyPair\:\:base64UrlEncode\(\) expects string, mixed given\.$#' + identifier: argument.type + count: 1 + path: server/src/Auth/DPoPKeyPair.php + + - + message: '#^Parameter \#3 \$headers of class Fleetbase\\Solid\\Auth\\Contracts\\OidcResponse constructor expects array\\|string\>, array given\.$#' + identifier: argument.type + count: 1 + path: server/src/Auth/HttpOidcTransport.php + + - + message: '#^Method Fleetbase\\Solid\\Auth\\SolidIdTokenVerifier\:\:decode\(\) should return array\ but returns array\\.$#' + identifier: return.type + count: 1 + path: server/src/Auth/SolidIdTokenVerifier.php + + - + message: '#^Access to an undefined property Fleetbase\\Solid\\Models\\SolidIdentity\:\:\$uuid\.$#' + identifier: property.notFound count: 8 path: server/src/Client/OpenIDConnectClient.php - - message: "#^Cannot cast mixed to int\\.$#" + message: '#^Binary operation "\." between ''identity_'' and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: server/src/Client/OpenIDConnectClient.php + + - + message: '#^Binary operation "\." between ''oidc\:'' and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: server/src/Client/OpenIDConnectClient.php + + - + message: '#^Binary operation "\." between ''solid/dpop_keys_'' and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: server/src/Client/OpenIDConnectClient.php + + - + message: '#^Cannot cast mixed to string\.$#' + identifier: cast.string + count: 1 + path: server/src/Client/OpenIDConnectClient.php + + - + message: '#^Method Fleetbase\\Solid\\Client\\OpenIDConnectClient\:\:decodeJwtSection\(\) should return array\\|null but returns array\\|null\.$#' + identifier: return.type + count: 1 + path: server/src/Client/OpenIDConnectClient.php + + - + message: '#^Parameter \#1 \$stored of static method Fleetbase\\Solid\\Auth\\DPoPKeyPair\:\:fromArray\(\) expects array\\|null, array\\|null given\.$#' + identifier: argument.type + count: 2 + path: server/src/Client/OpenIDConnectClient.php + + - + message: '#^Parameter \#2 \$body of method Fleetbase\\Solid\\Auth\\Contracts\\OidcTransport\:\:postJson\(\) expects array\, array\ given\.$#' + identifier: argument.type + count: 1 + path: server/src/Client/OpenIDConnectClient.php + + - + message: '#^Cannot access offset ''Content\-Type'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible + count: 2 + path: server/src/Client/SolidClient.php + + - + message: '#^Cannot call method body\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: server/src/Client/SolidClient.php + + - + message: '#^Cannot call method environment\(\) on mixed\.$#' + identifier: method.nonObject + count: 2 + path: server/src/Client/SolidClient.php + + - + message: '#^Cannot call method headers\(\) on mixed\.$#' + identifier: method.nonObject count: 1 path: server/src/Client/SolidClient.php - - message: "#^Cannot cast mixed to string\\.$#" + message: '#^Cannot call method status\(\) on mixed\.$#' + identifier: method.nonObject count: 1 path: server/src/Client/SolidClient.php - - message: "#^Constant Fleetbase\\\\Solid\\\\Client\\\\SolidClient\\:\\:DEFAULT_MIME_TYPE is unused\\.$#" + message: '#^Cannot cast mixed to int\.$#' + identifier: cast.int + count: 2 + path: server/src/Client/SolidClient.php + + - + message: '#^Cannot cast mixed to string\.$#' + identifier: cast.string + count: 2 + path: server/src/Client/SolidClient.php + + - + message: '#^Constant Fleetbase\\Solid\\Client\\SolidClient\:\:DEFAULT_MIME_TYPE is unused\.$#' + identifier: classConstant.unused count: 1 path: server/src/Client/SolidClient.php - - message: "#^Constant Fleetbase\\\\Solid\\\\Client\\\\SolidClient\\:\\:LDP_BASIC_CONTAINER is unused\\.$#" + message: '#^Constant Fleetbase\\Solid\\Client\\SolidClient\:\:LDP_BASIC_CONTAINER is unused\.$#' + identifier: classConstant.unused count: 1 path: server/src/Client/SolidClient.php - - message: "#^Constant Fleetbase\\\\Solid\\\\Client\\\\SolidClient\\:\\:LDP_RESOURCE is unused\\.$#" + message: '#^Constant Fleetbase\\Solid\\Client\\SolidClient\:\:LDP_RESOURCE is unused\.$#' + identifier: classConstant.unused count: 1 path: server/src/Client/SolidClient.php - - message: "#^Constant Fleetbase\\\\Solid\\\\Client\\\\SolidClient\\:\\:OIDC_ISSUER is unused\\.$#" + message: '#^Constant Fleetbase\\Solid\\Client\\SolidClient\:\:OIDC_ISSUER is unused\.$#' + identifier: classConstant.unused count: 1 path: server/src/Client/SolidClient.php - - message: "#^Function app not found\\.$#" + message: '#^Function app not found\.$#' + identifier: function.notFound count: 2 path: server/src/Client/SolidClient.php - - message: "#^Function config not found\\.$#" + message: '#^Function config not found\.$#' + identifier: function.notFound + count: 1 + path: server/src/Client/SolidClient.php + + - + message: '#^Method Fleetbase\\Solid\\Client\\SolidClient\:\:__construct\(\) has parameter \$options with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: server/src/Client/SolidClient.php + + - + message: '#^Method Fleetbase\\Solid\\Client\\SolidClient\:\:authenticatedRequest\(\) has parameter \$data with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue count: 1 path: server/src/Client/SolidClient.php - - message: "#^Method Fleetbase\\\\Solid\\\\Client\\\\SolidClient\\:\\:__construct\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" + message: '#^Method Fleetbase\\Solid\\Client\\SolidClient\:\:authenticatedRequest\(\) has parameter \$options with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue count: 1 path: server/src/Client/SolidClient.php - - message: "#^Method Fleetbase\\\\Solid\\\\Client\\\\SolidClient\\:\\:authenticatedRequest\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#" + message: '#^Method Fleetbase\\Solid\\Client\\SolidClient\:\:authenticatedRequest\(\) should return Illuminate\\Http\\Client\\Response but returns mixed\.$#' + identifier: return.type count: 1 path: server/src/Client/SolidClient.php - - message: "#^Method Fleetbase\\\\Solid\\\\Client\\\\SolidClient\\:\\:authenticatedRequest\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" + message: '#^Method Fleetbase\\Solid\\Client\\SolidClient\:\:create\(\) has parameter \$options with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue count: 1 path: server/src/Client/SolidClient.php - - message: "#^Method Fleetbase\\\\Solid\\\\Client\\\\SolidClient\\:\\:create\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" + message: '#^Method Fleetbase\\Solid\\Client\\SolidClient\:\:delete\(\) has parameter \$data with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue count: 1 path: server/src/Client/SolidClient.php - - message: "#^Method Fleetbase\\\\Solid\\\\Client\\\\SolidClient\\:\\:createRequestUrl\\(\\) should return string but returns string\\|null\\.$#" + message: '#^Method Fleetbase\\Solid\\Client\\SolidClient\:\:delete\(\) has parameter \$options with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue count: 1 path: server/src/Client/SolidClient.php - - message: "#^Method Fleetbase\\\\Solid\\\\Client\\\\SolidClient\\:\\:delete\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#" + message: '#^Method Fleetbase\\Solid\\Client\\SolidClient\:\:get\(\) has parameter \$data with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue count: 1 path: server/src/Client/SolidClient.php - - message: "#^Method Fleetbase\\\\Solid\\\\Client\\\\SolidClient\\:\\:delete\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" + message: '#^Method Fleetbase\\Solid\\Client\\SolidClient\:\:get\(\) has parameter \$options with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue count: 1 path: server/src/Client/SolidClient.php - - message: "#^Method Fleetbase\\\\Solid\\\\Client\\\\SolidClient\\:\\:get\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#" + message: '#^Method Fleetbase\\Solid\\Client\\SolidClient\:\:patch\(\) has parameter \$data with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue count: 1 path: server/src/Client/SolidClient.php - - message: "#^Method Fleetbase\\\\Solid\\\\Client\\\\SolidClient\\:\\:get\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" + message: '#^Method Fleetbase\\Solid\\Client\\SolidClient\:\:patch\(\) has parameter \$options with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue count: 1 path: server/src/Client/SolidClient.php - - message: "#^Method Fleetbase\\\\Solid\\\\Client\\\\SolidClient\\:\\:patch\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#" + message: '#^Method Fleetbase\\Solid\\Client\\SolidClient\:\:post\(\) has parameter \$data with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue count: 1 path: server/src/Client/SolidClient.php - - message: "#^Method Fleetbase\\\\Solid\\\\Client\\\\SolidClient\\:\\:patch\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" + message: '#^Method Fleetbase\\Solid\\Client\\SolidClient\:\:post\(\) has parameter \$options with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue count: 1 path: server/src/Client/SolidClient.php - - message: "#^Method Fleetbase\\\\Solid\\\\Client\\\\SolidClient\\:\\:post\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#" + message: '#^Method Fleetbase\\Solid\\Client\\SolidClient\:\:put\(\) has parameter \$data with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue count: 1 path: server/src/Client/SolidClient.php - - message: "#^Method Fleetbase\\\\Solid\\\\Client\\\\SolidClient\\:\\:post\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" + message: '#^Method Fleetbase\\Solid\\Client\\SolidClient\:\:put\(\) has parameter \$options with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue count: 1 path: server/src/Client/SolidClient.php - - message: "#^Method Fleetbase\\\\Solid\\\\Client\\\\SolidClient\\:\\:put\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#" + message: '#^Method Fleetbase\\Solid\\Client\\SolidClient\:\:request\(\) has parameter \$data with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue count: 1 path: server/src/Client/SolidClient.php - - message: "#^Method Fleetbase\\\\Solid\\\\Client\\\\SolidClient\\:\\:put\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" + message: '#^Method Fleetbase\\Solid\\Client\\SolidClient\:\:request\(\) has parameter \$options with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue count: 1 path: server/src/Client/SolidClient.php - - message: "#^Method Fleetbase\\\\Solid\\\\Client\\\\SolidClient\\:\\:request\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#" + message: '#^Method Fleetbase\\Solid\\Client\\SolidClient\:\:request\(\) should return Illuminate\\Http\\Client\\Response but returns mixed\.$#' + identifier: return.type count: 1 path: server/src/Client/SolidClient.php - - message: "#^Method Fleetbase\\\\Solid\\\\Client\\\\SolidClient\\:\\:request\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" + message: '#^Method Fleetbase\\Solid\\Client\\SolidClient\:\:requestWithIdentity\(\) has parameter \$data with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue count: 1 path: server/src/Client/SolidClient.php - - message: "#^Method Fleetbase\\\\Solid\\\\Client\\\\SolidClient\\:\\:requestWithIdentity\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#" + message: '#^Method Fleetbase\\Solid\\Client\\SolidClient\:\:requestWithIdentity\(\) has parameter \$options with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue count: 1 path: server/src/Client/SolidClient.php - - message: "#^Method Fleetbase\\\\Solid\\\\Client\\\\SolidClient\\:\\:requestWithIdentity\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" + message: '#^Parameter \#1 \$haystack of static method Illuminate\\Support\\Str\:\:startsWith\(\) expects string, string\|null given\.$#' + identifier: argument.type count: 1 path: server/src/Client/SolidClient.php - - message: "#^Parameter \\#1 \\$haystack of static method Illuminate\\\\Support\\\\Str\\:\\:startsWith\\(\\) expects string, string\\|null given\\.$#" + message: '#^Parameter \#1 \$options of static method Fleetbase\\Solid\\Client\\OpenIDConnectClient\:\:create\(\) expects array\, array given\.$#' + identifier: argument.type count: 1 path: server/src/Client/SolidClient.php - - message: "#^Unsafe usage of new static\\(\\)\\.$#" + message: '#^Parameter \#2 \$contentType of method Illuminate\\Http\\Client\\PendingRequest\\:\:withBody\(\) expects string, mixed given\.$#' + identifier: argument.type + count: 2 + path: server/src/Client/SolidClient.php + + - + message: '#^Unsafe usage of new static\(\)\.$#' + identifier: new.static count: 1 path: server/src/Client/SolidClient.php - - message: "#^Function app not found\\.$#" + message: '#^Binary operation "\." between non\-falsy\-string and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: server/src/Http/Controllers/DataController.php + + - + message: '#^Cannot call method findWritableLocations\(\) on mixed\.$#' + identifier: method.nonObject + count: 2 + path: server/src/Http/Controllers/DataController.php + + - + message: '#^Cannot call method isWritable\(\) on mixed\.$#' + identifier: method.nonObject + count: 2 + path: server/src/Http/Controllers/DataController.php + + - + message: '#^Cannot call method json\(\) on mixed\.$#' + identifier: method.nonObject + count: 19 + path: server/src/Http/Controllers/DataController.php + + - + message: '#^Function app not found\.$#' + identifier: function.notFound count: 2 path: server/src/Http/Controllers/DataController.php - - message: "#^Function response not found\\.$#" + message: '#^Function response not found\.$#' + identifier: function.notFound count: 19 path: server/src/Http/Controllers/DataController.php - - message: "#^Method Fleetbase\\\\Solid\\\\Http\\\\Controllers\\\\DataController\\:\\:createFolder\\(\\) has no return type specified\\.$#" + message: '#^Method Fleetbase\\Solid\\Http\\Controllers\\DataController\:\:createFolder\(\) has no return type specified\.$#' + identifier: missingType.return + count: 1 + path: server/src/Http/Controllers/DataController.php + + - + message: '#^Method Fleetbase\\Solid\\Http\\Controllers\\DataController\:\:deleteItem\(\) has no return type specified\.$#' + identifier: missingType.return + count: 1 + path: server/src/Http/Controllers/DataController.php + + - + message: '#^Method Fleetbase\\Solid\\Http\\Controllers\\DataController\:\:importResources\(\) has no return type specified\.$#' + identifier: missingType.return count: 1 path: server/src/Http/Controllers/DataController.php - - message: "#^Method Fleetbase\\\\Solid\\\\Http\\\\Controllers\\\\DataController\\:\\:deleteItem\\(\\) has no return type specified\\.$#" + message: '#^Method Fleetbase\\Solid\\Http\\Controllers\\DataController\:\:index\(\) has no return type specified\.$#' + identifier: missingType.return count: 1 path: server/src/Http/Controllers/DataController.php - - message: "#^Method Fleetbase\\\\Solid\\\\Http\\\\Controllers\\\\DataController\\:\\:importResources\\(\\) has no return type specified\\.$#" + message: '#^Method Fleetbase\\Solid\\Http\\Controllers\\DataController\:\:showFolder\(\) has no return type specified\.$#' + identifier: missingType.return count: 1 path: server/src/Http/Controllers/DataController.php - - message: "#^Method Fleetbase\\\\Solid\\\\Http\\\\Controllers\\\\DataController\\:\\:index\\(\\) has no return type specified\\.$#" + message: '#^Negated boolean expression is always false\.$#' + identifier: booleanNot.alwaysFalse + count: 5 + path: server/src/Http/Controllers/DataController.php + + - + message: '#^Parameter \#1 \$array of function array_values expects array\, mixed given\.$#' + identifier: argument.type count: 1 path: server/src/Http/Controllers/DataController.php - - message: "#^Method Fleetbase\\\\Solid\\\\Http\\\\Controllers\\\\DataController\\:\\:showFolder\\(\\) has no return type specified\\.$#" + message: '#^Parameter \#1 \$string of function trim expects string, mixed given\.$#' + identifier: argument.type count: 1 path: server/src/Http/Controllers/DataController.php - - message: "#^Negated boolean expression is always false\\.$#" + message: '#^Parameter \#1 \$webId of method Fleetbase\\Solid\\Services\\PodService\:\:getPodUrlFromWebId\(\) expects string, mixed given\.$#' + identifier: argument.type count: 5 path: server/src/Http/Controllers/DataController.php - - message: "#^Parameter \\#1 \\$string of function trim expects string, mixed given\\.$#" + message: '#^Parameter \#3 \$folderName of method Fleetbase\\Solid\\Services\\PodService\:\:createFolder\(\) expects string, mixed given\.$#' + identifier: argument.type + count: 1 + path: server/src/Http/Controllers/DataController.php + + - + message: '#^Parameter \#3 \$resourceTypes of method Fleetbase\\Solid\\Services\\ResourceSyncService\:\:importResources\(\) expects array, mixed given\.$#' + identifier: argument.type count: 1 path: server/src/Http/Controllers/DataController.php - - message: "#^Parameter \\#3 \\$folderName of method Fleetbase\\\\Solid\\\\Services\\\\PodService\\:\\:createFolder\\(\\) expects string, mixed given\\.$#" + message: '#^Part \$folderName \(mixed\) of encapsed string cannot be cast to string\.$#' + identifier: encapsedStringPart.nonString count: 1 path: server/src/Http/Controllers/DataController.php - - message: "#^Parameter \\#3 \\$resourceTypes of method Fleetbase\\\\Solid\\\\Services\\\\ResourceSyncService\\:\\:importResources\\(\\) expects array, mixed given\\.$#" + message: '#^Part \$result\[''total_count''\] \(mixed\) of encapsed string cannot be cast to string\.$#' + identifier: encapsedStringPart.nonString count: 1 path: server/src/Http/Controllers/DataController.php - - message: "#^Part \\$folderName \\(mixed\\) of encapsed string cannot be cast to string\\.$#" + message: '#^Part \$suggestion \(mixed\) of encapsed string cannot be cast to string\.$#' + identifier: encapsedStringPart.nonString count: 1 path: server/src/Http/Controllers/DataController.php - - message: "#^Call to an undefined static method Fleetbase\\\\Solid\\\\Models\\\\SolidIdentity\\:\\:where\\(\\)\\.$#" + message: '#^Call to an undefined static method Fleetbase\\Solid\\Models\\SolidIdentity\:\:where\(\)\.$#' + identifier: staticMethod.notFound + count: 1 + path: server/src/Http/Controllers/OIDCController.php + + - + message: '#^Cannot call method first\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: server/src/Http/Controllers/OIDCController.php + + - + message: '#^Cannot call method storeTokenResponse\(\) on mixed\.$#' + identifier: method.nonObject count: 1 path: server/src/Http/Controllers/OIDCController.php - - message: "#^Function redirect not found\\.$#" + message: '#^Function redirect not found\.$#' + identifier: function.notFound + count: 2 + path: server/src/Http/Controllers/OIDCController.php + + - + message: '#^Method Fleetbase\\Solid\\Http\\Controllers\\OIDCController\:\:completeRegistration\(\) should return Illuminate\\Http\\RedirectResponse but returns mixed\.$#' + identifier: return.type count: 2 path: server/src/Http/Controllers/OIDCController.php - - message: "#^Access to an undefined property Fleetbase\\\\Solid\\\\Models\\\\SolidIdentity\\:\\:\\$created_at\\.$#" + message: '#^Access to an undefined property Fleetbase\\Solid\\Models\\SolidIdentity\:\:\$created_at\.$#' + identifier: property.notFound count: 1 path: server/src/Http/Controllers/SolidController.php - - message: "#^Access to an undefined property Fleetbase\\\\Solid\\\\Models\\\\SolidIdentity\\:\\:\\$id\\.$#" + message: '#^Access to an undefined property Fleetbase\\Solid\\Models\\SolidIdentity\:\:\$id\.$#' + identifier: property.notFound count: 1 path: server/src/Http/Controllers/SolidController.php - - message: "#^Access to an undefined property Fleetbase\\\\Solid\\\\Models\\\\SolidIdentity\\:\\:\\$identifier\\.$#" + message: '#^Access to an undefined property Fleetbase\\Solid\\Models\\SolidIdentity\:\:\$identifier\.$#' + identifier: property.notFound count: 2 path: server/src/Http/Controllers/SolidController.php - - message: "#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\\.$#" + message: '#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\.$#' + identifier: foreach.nonIterable + count: 1 + path: server/src/Http/Controllers/SolidController.php + + - + message: '#^Call to an undefined method Fleetbase\\Http\\Requests\\AdminRequest\:\:inputArray\(\)\.$#' + identifier: method.notFound + count: 1 + path: server/src/Http/Controllers/SolidController.php + + - + message: '#^Call to an undefined static method Fleetbase\\Solid\\Models\\SolidIdentity\:\:where\(\)\.$#' + identifier: staticMethod.notFound + count: 1 + path: server/src/Http/Controllers/SolidController.php + + - + message: '#^Cannot access property \$id on mixed\.$#' + identifier: property.nonObject count: 1 path: server/src/Http/Controllers/SolidController.php - - message: "#^Call to an undefined method Fleetbase\\\\Http\\\\Requests\\\\AdminRequest\\:\\:array\\(\\)\\.$#" + message: '#^Cannot call method body\(\) on mixed\.$#' + identifier: method.nonObject + count: 2 + path: server/src/Http/Controllers/SolidController.php + + - + message: '#^Cannot call method first\(\) on mixed\.$#' + identifier: method.nonObject count: 1 path: server/src/Http/Controllers/SolidController.php - - message: "#^Call to an undefined static method Fleetbase\\\\Solid\\\\Models\\\\SolidIdentity\\:\\:where\\(\\)\\.$#" + message: '#^Cannot call method getRedirectUri\(\) on mixed\.$#' + identifier: method.nonObject count: 1 path: server/src/Http/Controllers/SolidController.php - - message: "#^Function config not found\\.$#" + message: '#^Cannot call method json\(\) on mixed\.$#' + identifier: method.nonObject + count: 17 + path: server/src/Http/Controllers/SolidController.php + + - + message: '#^Cannot call method status\(\) on mixed\.$#' + identifier: method.nonObject + count: 2 + path: server/src/Http/Controllers/SolidController.php + + - + message: '#^Cannot call method successful\(\) on mixed\.$#' + identifier: method.nonObject + count: 2 + path: server/src/Http/Controllers/SolidController.php + + - + message: '#^Function config not found\.$#' + identifier: function.notFound count: 3 path: server/src/Http/Controllers/SolidController.php - - message: "#^Function redirect not found\\.$#" + message: '#^Function redirect not found\.$#' + identifier: function.notFound count: 1 path: server/src/Http/Controllers/SolidController.php - - message: "#^Function response not found\\.$#" + message: '#^Function response not found\.$#' + identifier: function.notFound count: 16 path: server/src/Http/Controllers/SolidController.php - - message: "#^If condition is always true\\.$#" + message: '#^If condition is always true\.$#' + identifier: if.alwaysTrue count: 1 path: server/src/Http/Controllers/SolidController.php - - message: "#^Method Fleetbase\\\\Solid\\\\Http\\\\Controllers\\\\SolidController\\:\\:authenticate\\(\\) has no return type specified\\.$#" + message: '#^Method Fleetbase\\Solid\\Http\\Controllers\\SolidController\:\:authenticate\(\) has no return type specified\.$#' + identifier: missingType.return count: 1 path: server/src/Http/Controllers/SolidController.php - - message: "#^Method Fleetbase\\\\Solid\\\\Http\\\\Controllers\\\\SolidController\\:\\:getAccountIndex\\(\\) has no return type specified\\.$#" + message: '#^Method Fleetbase\\Solid\\Http\\Controllers\\SolidController\:\:getAccountIndex\(\) has no return type specified\.$#' + identifier: missingType.return count: 1 path: server/src/Http/Controllers/SolidController.php - - message: "#^Method Fleetbase\\\\Solid\\\\Http\\\\Controllers\\\\SolidController\\:\\:getAuthenticationStatus\\(\\) has no return type specified\\.$#" + message: '#^Method Fleetbase\\Solid\\Http\\Controllers\\SolidController\:\:getAuthenticationStatus\(\) has no return type specified\.$#' + identifier: missingType.return count: 1 path: server/src/Http/Controllers/SolidController.php - - message: "#^Method Fleetbase\\\\Solid\\\\Http\\\\Controllers\\\\SolidController\\:\\:getPods\\(\\) has no return type specified\\.$#" + message: '#^Method Fleetbase\\Solid\\Http\\Controllers\\SolidController\:\:getPods\(\) has no return type specified\.$#' + identifier: missingType.return count: 1 path: server/src/Http/Controllers/SolidController.php - - message: "#^Method Fleetbase\\\\Solid\\\\Http\\\\Controllers\\\\SolidController\\:\\:getServerConfig\\(\\) has no return type specified\\.$#" + message: '#^Method Fleetbase\\Solid\\Http\\Controllers\\SolidController\:\:getServerConfig\(\) has no return type specified\.$#' + identifier: missingType.return count: 1 path: server/src/Http/Controllers/SolidController.php - - message: "#^Method Fleetbase\\\\Solid\\\\Http\\\\Controllers\\\\SolidController\\:\\:hello\\(\\) has no return type specified\\.$#" + message: '#^Method Fleetbase\\Solid\\Http\\Controllers\\SolidController\:\:hello\(\) has no return type specified\.$#' + identifier: missingType.return count: 1 path: server/src/Http/Controllers/SolidController.php - - message: "#^Method Fleetbase\\\\Solid\\\\Http\\\\Controllers\\\\SolidController\\:\\:logout\\(\\) has no return type specified\\.$#" + message: '#^Method Fleetbase\\Solid\\Http\\Controllers\\SolidController\:\:logout\(\) has no return type specified\.$#' + identifier: missingType.return count: 1 path: server/src/Http/Controllers/SolidController.php - - message: "#^Method Fleetbase\\\\Solid\\\\Http\\\\Controllers\\\\SolidController\\:\\:parseContainers\\(\\) return type has no value type specified in iterable type array\\.$#" + message: '#^Method Fleetbase\\Solid\\Http\\Controllers\\SolidController\:\:parseContainers\(\) return type has no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue count: 1 path: server/src/Http/Controllers/SolidController.php - - message: "#^Method Fleetbase\\\\Solid\\\\Http\\\\Controllers\\\\SolidController\\:\\:requestAuthentication\\(\\) has no return type specified\\.$#" + message: '#^Method Fleetbase\\Solid\\Http\\Controllers\\SolidController\:\:requestAuthentication\(\) has no return type specified\.$#' + identifier: missingType.return count: 1 path: server/src/Http/Controllers/SolidController.php - - message: "#^Method Fleetbase\\\\Solid\\\\Http\\\\Controllers\\\\SolidController\\:\\:saveServerConfig\\(\\) has no return type specified\\.$#" + message: '#^Method Fleetbase\\Solid\\Http\\Controllers\\SolidController\:\:saveServerConfig\(\) has no return type specified\.$#' + identifier: missingType.return count: 1 path: server/src/Http/Controllers/SolidController.php - - message: "#^Negated boolean expression is always false\\.$#" + message: '#^Negated boolean expression is always false\.$#' + identifier: booleanNot.alwaysFalse count: 2 path: server/src/Http/Controllers/SolidController.php - - message: "#^Parameter \\#1 \\$url of method Fleetbase\\\\Solid\\\\Http\\\\Controllers\\\\SolidController\\:\\:extractPodName\\(\\) expects string, mixed given\\.$#" + message: '#^Parameter \#1 \$content of method Fleetbase\\Solid\\Http\\Controllers\\SolidController\:\:parseContainers\(\) expects string, mixed given\.$#' + identifier: argument.type count: 1 path: server/src/Http/Controllers/SolidController.php - - message: "#^Parameter \\#2 \\$uri of method Fleetbase\\\\Solid\\\\Models\\\\SolidIdentity\\:\\:request\\(\\) expects string, mixed given\\.$#" + message: '#^Parameter \#1 \$url of method Fleetbase\\Solid\\Http\\Controllers\\SolidController\:\:extractPodName\(\) expects string, mixed given\.$#' + identifier: argument.type count: 1 path: server/src/Http/Controllers/SolidController.php - - message: "#^Parameter \\#2 \\.\\.\\.\\$arrays of function array_merge expects array, mixed given\\.$#" + message: '#^Parameter \#1 \.\.\.\$arrays of function array_merge expects array, mixed given\.$#' + identifier: argument.type + count: 2 + path: server/src/Http/Controllers/SolidController.php + + - + message: '#^Parameter \#2 \$uri of method Fleetbase\\Solid\\Models\\SolidIdentity\:\:request\(\) expects string, mixed given\.$#' + identifier: argument.type count: 1 path: server/src/Http/Controllers/SolidController.php - - message: "#^Access to an undefined property Fleetbase\\\\Solid\\\\Models\\\\SolidIdentity\\:\\:\\$identifier\\.$#" + message: '#^Parameter \#2 \.\.\.\$arrays of function array_merge expects array, mixed given\.$#' + identifier: argument.type + count: 2 + path: server/src/Http/Controllers/SolidController.php + + - + message: '#^Access to an undefined property Fleetbase\\Solid\\Models\\SolidIdentity\:\:\$identifier\.$#' + identifier: property.notFound + count: 1 + path: server/src/Models/SolidIdentity.php + + - + message: '#^Binary operation "\." between ''solid/int/v1/oidc…'' and mixed results in an error\.$#' + identifier: binaryOp.invalid count: 1 path: server/src/Models/SolidIdentity.php - - message: "#^Call to an undefined static method Fleetbase\\\\Solid\\\\Models\\\\SolidIdentity\\:\\:firstOrCreate\\(\\)\\.$#" + message: '#^Call to an undefined static method Fleetbase\\Solid\\Models\\SolidIdentity\:\:firstOrCreate\(\)\.$#' + identifier: staticMethod.notFound count: 1 path: server/src/Models/SolidIdentity.php - - message: "#^Call to an undefined static method Fleetbase\\\\Solid\\\\Models\\\\SolidIdentity\\:\\:where\\(\\)\\.$#" + message: '#^Call to an undefined static method Fleetbase\\Solid\\Models\\SolidIdentity\:\:where\(\)\.$#' + identifier: staticMethod.notFound count: 2 path: server/src/Models/SolidIdentity.php - - message: "#^Function session not found\\.$#" + message: '#^Cannot access property \$identifier on mixed\.$#' + identifier: property.nonObject + count: 1 + path: server/src/Models/SolidIdentity.php + + - + message: '#^Cannot call method exists\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: server/src/Models/SolidIdentity.php + + - + message: '#^Cannot call method first\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: server/src/Models/SolidIdentity.php + + - + message: '#^Cannot call method generateRequestCode\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: server/src/Models/SolidIdentity.php + + - + message: '#^Cannot call method update\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: server/src/Models/SolidIdentity.php + + - + message: '#^Function session not found\.$#' + identifier: function.notFound count: 4 path: server/src/Models/SolidIdentity.php - - message: "#^Method Fleetbase\\\\Solid\\\\Models\\\\SolidIdentity\\:\\:getRedirectUri\\(\\) has parameter \\$query with no value type specified in iterable type array\\.$#" + message: '#^Method Fleetbase\\Solid\\Models\\SolidIdentity\:\:current\(\) should return Fleetbase\\Solid\\Models\\SolidIdentity but returns mixed\.$#' + identifier: return.type count: 1 path: server/src/Models/SolidIdentity.php - - message: "#^Method Fleetbase\\\\Solid\\\\Models\\\\SolidIdentity\\:\\:request\\(\\) has no return type specified\\.$#" + message: '#^Method Fleetbase\\Solid\\Models\\SolidIdentity\:\:getRedirectUri\(\) has parameter \$query with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue count: 1 path: server/src/Models/SolidIdentity.php - - message: "#^Method Fleetbase\\\\Solid\\\\Models\\\\SolidIdentity\\:\\:request\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#" + message: '#^Method Fleetbase\\Solid\\Models\\SolidIdentity\:\:initialize\(\) should return Fleetbase\\Solid\\Models\\SolidIdentity but returns mixed\.$#' + identifier: return.type count: 1 path: server/src/Models/SolidIdentity.php - - message: "#^Method Fleetbase\\\\Solid\\\\Models\\\\SolidIdentity\\:\\:request\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" + message: '#^Method Fleetbase\\Solid\\Models\\SolidIdentity\:\:request\(\) has no return type specified\.$#' + identifier: missingType.return count: 1 path: server/src/Models/SolidIdentity.php - - message: "#^PHPDoc type array of property Fleetbase\\\\Solid\\\\Models\\\\SolidIdentity\\:\\:\\$fillable is not covariant with PHPDoc type array\\ of overridden property Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:\\$fillable\\.$#" + message: '#^Method Fleetbase\\Solid\\Models\\SolidIdentity\:\:request\(\) has parameter \$data with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue count: 1 path: server/src/Models/SolidIdentity.php - - message: "#^Property Fleetbase\\\\Solid\\\\Models\\\\SolidIdentity\\:\\:\\$casts type has no value type specified in iterable type array\\.$#" + message: '#^Method Fleetbase\\Solid\\Models\\SolidIdentity\:\:request\(\) has parameter \$options with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue count: 1 path: server/src/Models/SolidIdentity.php - - message: "#^Property Fleetbase\\\\Solid\\\\Models\\\\SolidIdentity\\:\\:\\$fillable type has no value type specified in iterable type array\\.$#" + message: '#^PHPDoc type array of property Fleetbase\\Solid\\Models\\SolidIdentity\:\:\$fillable is not covariant with PHPDoc type array\ of overridden property Illuminate\\Database\\Eloquent\\Model\:\:\$fillable\.$#' + identifier: property.phpDocType count: 1 path: server/src/Models/SolidIdentity.php - - message: "#^Property Fleetbase\\\\Solid\\\\Providers\\\\SolidServiceProvider\\:\\:\\$observers type has no value type specified in iterable type array\\.$#" + message: '#^Parameter \#1 \$related of method Illuminate\\Database\\Eloquent\\Model\:\:belongsTo\(\) expects class\-string\, string given\.$#' + identifier: argument.type count: 1 - path: server/src/Providers/SolidServiceProvider.php + path: server/src/Models/SolidIdentity.php - - message: "#^Method Fleetbase\\\\Solid\\\\Services\\\\AclService\\:\\:findWritableLocations\\(\\) has parameter \\$profile with no value type specified in iterable type array\\.$#" + message: '#^Property Fleetbase\\Solid\\Models\\SolidIdentity\:\:\$casts type has no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue count: 1 - path: server/src/Services/AclService.php + path: server/src/Models/SolidIdentity.php - - message: "#^Method Fleetbase\\\\Solid\\\\Services\\\\AclService\\:\\:findWritableLocations\\(\\) return type has no value type specified in iterable type array\\.$#" + message: '#^Property Fleetbase\\Solid\\Models\\SolidIdentity\:\:\$fillable type has no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue count: 1 - path: server/src/Services/AclService.php + path: server/src/Models/SolidIdentity.php - - message: "#^Access to an undefined property Fleetbase\\\\Solid\\\\Models\\\\SolidIdentity\\:\\:\\$webid\\.$#" + message: '#^Unable to resolve the template type TRelatedModel in call to method Illuminate\\Database\\Eloquent\\Model\:\:belongsTo\(\)$#' + identifier: argument.templateType count: 1 - path: server/src/Services/PodService.php + path: server/src/Models/SolidIdentity.php - - message: "#^Call to method firstWhere\\(\\) on an unknown class IlluminateAgnostic\\\\StrAgnostic\\\\Str\\\\Support\\\\Collection\\.$#" - count: 2 - path: server/src/Services/PodService.php + message: '#^Property Fleetbase\\Solid\\Providers\\SolidServiceProvider\:\:\$observers type has no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: server/src/Providers/SolidServiceProvider.php + + - + message: '#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\.$#' + identifier: foreach.nonIterable + count: 1 + path: server/src/Services/AclService.php - - message: "#^Cannot access offset 'url' on mixed\\.$#" + message: '#^Cannot call method body\(\) on mixed\.$#' + identifier: method.nonObject count: 2 - path: server/src/Services/PodService.php + path: server/src/Services/AclService.php - - message: "#^Function app not found\\.$#" - count: 1 - path: server/src/Services/PodService.php + message: '#^Cannot call method header\(\) on mixed\.$#' + identifier: method.nonObject + count: 3 + path: server/src/Services/AclService.php - - message: "#^Function now not found\\.$#" + message: '#^Cannot call method status\(\) on mixed\.$#' + identifier: method.nonObject count: 5 - path: server/src/Services/PodService.php + path: server/src/Services/AclService.php + + - + message: '#^Cannot call method successful\(\) on mixed\.$#' + identifier: method.nonObject + count: 5 + path: server/src/Services/AclService.php - - message: "#^Method Fleetbase\\\\Solid\\\\Services\\\\PodService\\:\\:createPod\\(\\) return type has no value type specified in iterable type array\\.$#" + message: '#^Method Fleetbase\\Solid\\Services\\AclService\:\:findWritableLocations\(\) has parameter \$profile with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue count: 1 - path: server/src/Services/PodService.php + path: server/src/Services/AclService.php - - message: "#^Method Fleetbase\\\\Solid\\\\Services\\\\PodService\\:\\:createPodInStorage\\(\\) return type has no value type specified in iterable type array\\.$#" + message: '#^Method Fleetbase\\Solid\\Services\\AclService\:\:findWritableLocations\(\) return type has no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue count: 1 - path: server/src/Services/PodService.php + path: server/src/Services/AclService.php + + - + message: '#^Parameter \#1 \$haystack of function str_contains expects string, mixed given\.$#' + identifier: argument.type + count: 2 + path: server/src/Services/AclService.php - - message: "#^Method Fleetbase\\\\Solid\\\\Services\\\\PodService\\:\\:extractResourceMetadata\\(\\) return type has no value type specified in iterable type array\\.$#" + message: '#^Parameter \#1 \$storage of method Fleetbase\\Solid\\Services\\AclService\:\:resolveStorageUrl\(\) expects string, mixed given\.$#' + identifier: argument.type count: 1 - path: server/src/Services/PodService.php + path: server/src/Services/AclService.php - - message: "#^Method Fleetbase\\\\Solid\\\\Services\\\\PodService\\:\\:getContainers\\(\\) has parameter \\$storageLocations with no value type specified in iterable type array\\.$#" + message: '#^Parameter \#1 \$webId of method Fleetbase\\Solid\\Services\\PodService\:\:getPodUrlFromWebId\(\) expects string, mixed given\.$#' + identifier: argument.type count: 1 - path: server/src/Services/PodService.php + path: server/src/Services/AclService.php + + - + message: '#^Parameter \#2 \$subject of function preg_match expects string, mixed given\.$#' + identifier: argument.type + count: 2 + path: server/src/Services/AclService.php - - message: "#^Method Fleetbase\\\\Solid\\\\Services\\\\PodService\\:\\:getContainers\\(\\) return type has no value type specified in iterable type array\\.$#" + message: '#^Parameter \#2 \$webId of method Fleetbase\\Solid\\Services\\AclService\:\:resolveStorageUrl\(\) expects string, mixed given\.$#' + identifier: argument.type count: 1 - path: server/src/Services/PodService.php + path: server/src/Services/AclService.php - - message: "#^Method Fleetbase\\\\Solid\\\\Services\\\\PodService\\:\\:getPodContents\\(\\) return type has no value type specified in iterable type array\\.$#" + message: '#^Access to an undefined property Fleetbase\\Solid\\Models\\SolidIdentity\:\:\$webid\.$#' + identifier: property.notFound count: 1 path: server/src/Services/PodService.php - - message: "#^Method Fleetbase\\\\Solid\\\\Services\\\\PodService\\:\\:getProfileData\\(\\) return type has no value type specified in iterable type array\\.$#" + message: '#^Binary operation "\." between '' dc\:created "'' and mixed results in an error\.$#' + identifier: binaryOp.invalid count: 1 path: server/src/Services/PodService.php - - message: "#^Method Fleetbase\\\\Solid\\\\Services\\\\PodService\\:\\:getUserPods\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 + message: '#^Cannot access offset ''url'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible + count: 2 path: server/src/Services/PodService.php - - message: "#^Method Fleetbase\\\\Solid\\\\Services\\\\PodService\\:\\:parseContainerContents\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 + message: '#^Cannot call method body\(\) on mixed\.$#' + identifier: method.nonObject + count: 10 path: server/src/Services/PodService.php - - message: "#^Method Fleetbase\\\\Solid\\\\Services\\\\PodService\\:\\:parseContainerUrls\\(\\) return type has no value type specified in iterable type array\\.$#" + message: '#^Cannot call method ensureFolderPermissions\(\) on mixed\.$#' + identifier: method.nonObject count: 1 path: server/src/Services/PodService.php - - message: "#^Method Fleetbase\\\\Solid\\\\Services\\\\PodService\\:\\:parsePodData\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 + message: '#^Cannot call method header\(\) on mixed\.$#' + identifier: method.nonObject + count: 4 path: server/src/Services/PodService.php - - message: "#^Method Fleetbase\\\\Solid\\\\Services\\\\PodService\\:\\:parseProfile\\(\\) return type has no value type specified in iterable type array\\.$#" + message: '#^Cannot call method headers\(\) on mixed\.$#' + identifier: method.nonObject count: 1 path: server/src/Services/PodService.php - - message: "#^Offset 'path' does not exist on array\\{scheme\\: string, host\\: string, port\\?\\: int\\<0, 65535\\>, user\\?\\: string, pass\\?\\: string, path\\?\\: string, query\\?\\: string, fragment\\?\\: string\\}\\.$#" - count: 1 + message: '#^Cannot call method status\(\) on mixed\.$#' + identifier: method.nonObject + count: 11 path: server/src/Services/PodService.php - - message: "#^Parameter \\#2 \\$uri of method Fleetbase\\\\Solid\\\\Models\\\\SolidIdentity\\:\\:request\\(\\) expects string, mixed given\\.$#" - count: 2 + message: '#^Cannot call method successful\(\) on mixed\.$#' + identifier: method.nonObject + count: 11 path: server/src/Services/PodService.php - - message: "#^Undefined variable\\: \\$folderUrl$#" - count: 1 + message: '#^Cannot call method toISOString\(\) on mixed\.$#' + identifier: method.nonObject + count: 5 path: server/src/Services/PodService.php - - message: "#^Access to an undefined property Fleetbase\\\\Solid\\\\Models\\\\SolidIdentity\\:\\:\\$webid\\.$#" + message: '#^Function app not found\.$#' + identifier: function.notFound count: 1 - path: server/src/Services/ResourceSyncService.php + path: server/src/Services/PodService.php - - message: "#^Cannot access property \\$public_id on mixed\\.$#" - count: 2 - path: server/src/Services/ResourceSyncService.php + message: '#^Function now not found\.$#' + identifier: function.notFound + count: 5 + path: server/src/Services/PodService.php - - message: "#^Function app not found\\.$#" + message: '#^Method Fleetbase\\Solid\\Services\\PodService\:\:createPod\(\) return type has no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue count: 1 - path: server/src/Services/ResourceSyncService.php + path: server/src/Services/PodService.php - - message: "#^Function auth not found\\.$#" + message: '#^Method Fleetbase\\Solid\\Services\\PodService\:\:createPodInStorage\(\) return type has no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue count: 1 - path: server/src/Services/ResourceSyncService.php + path: server/src/Services/PodService.php - - message: "#^Function session not found\\.$#" - count: 2 - path: server/src/Services/ResourceSyncService.php + message: '#^Method Fleetbase\\Solid\\Services\\PodService\:\:deletePod\(\) should return bool but returns mixed\.$#' + identifier: return.type + count: 1 + path: server/src/Services/PodService.php - - message: "#^Method Fleetbase\\\\Solid\\\\Services\\\\ResourceSyncService\\:\\:convertToRDF\\(\\) has parameter \\$resource with no type specified\\.$#" + message: '#^Method Fleetbase\\Solid\\Services\\PodService\:\:extractResourceMetadata\(\) return type has no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue count: 1 - path: server/src/Services/ResourceSyncService.php + path: server/src/Services/PodService.php - - message: "#^Method Fleetbase\\\\Solid\\\\Services\\\\ResourceSyncService\\:\\:formatRDFValue\\(\\) has parameter \\$value with no type specified\\.$#" + message: '#^Method Fleetbase\\Solid\\Services\\PodService\:\:getContainers\(\) has parameter \$storageLocations with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue count: 1 - path: server/src/Services/ResourceSyncService.php + path: server/src/Services/PodService.php - - message: "#^Method Fleetbase\\\\Solid\\\\Services\\\\ResourceSyncService\\:\\:getFleetopsResources\\(\\) should return Illuminate\\\\Support\\\\Collection but returns Illuminate\\\\Support\\\\Collection\\|IlluminateAgnostic\\\\StrAgnostic\\\\Str\\\\Support\\\\Collection\\.$#" + message: '#^Method Fleetbase\\Solid\\Services\\PodService\:\:getContainers\(\) return type has no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue count: 1 - path: server/src/Services/ResourceSyncService.php + path: server/src/Services/PodService.php - - message: "#^Method Fleetbase\\\\Solid\\\\Services\\\\ResourceSyncService\\:\\:getResourceProperties\\(\\) has parameter \\$resource with no type specified\\.$#" + message: '#^Method Fleetbase\\Solid\\Services\\PodService\:\:getPodContents\(\) return type has no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue count: 1 - path: server/src/Services/ResourceSyncService.php + path: server/src/Services/PodService.php - - message: "#^Method Fleetbase\\\\Solid\\\\Services\\\\ResourceSyncService\\:\\:getResourceProperties\\(\\) return type has no value type specified in iterable type array\\.$#" + message: '#^Method Fleetbase\\Solid\\Services\\PodService\:\:getProfileData\(\) return type has no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue count: 1 - path: server/src/Services/ResourceSyncService.php + path: server/src/Services/PodService.php - - message: "#^Method Fleetbase\\\\Solid\\\\Services\\\\ResourceSyncService\\:\\:importResourceType\\(\\) return type has no value type specified in iterable type array\\.$#" + message: '#^Method Fleetbase\\Solid\\Services\\PodService\:\:getUserPods\(\) return type has no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue count: 1 + path: server/src/Services/PodService.php + + - + message: '#^Method Fleetbase\\Solid\\Services\\PodService\:\:parseContainerContents\(\) return type has no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: server/src/Services/PodService.php + + - + message: '#^Method Fleetbase\\Solid\\Services\\PodService\:\:parseContainerUrls\(\) return type has no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: server/src/Services/PodService.php + + - + message: '#^Method Fleetbase\\Solid\\Services\\PodService\:\:parsePodData\(\) return type has no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: server/src/Services/PodService.php + + - + message: '#^Method Fleetbase\\Solid\\Services\\PodService\:\:parseProfile\(\) return type has no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: server/src/Services/PodService.php + + - + message: '#^Offset ''path'' might not exist on array\{scheme\: string, host\: string, port\?\: int\<0, 65535\>, user\?\: string, pass\?\: string, path\?\: string, query\?\: string, fragment\?\: string\}\.$#' + identifier: offsetAccess.notFound + count: 1 + path: server/src/Services/PodService.php + + - + message: '#^Parameter \#1 \$content of method Fleetbase\\Solid\\Services\\PodService\:\:parseContainerContents\(\) expects string, mixed given\.$#' + identifier: argument.type + count: 1 + path: server/src/Services/PodService.php + + - + message: '#^Parameter \#1 \$content of method Fleetbase\\Solid\\Services\\PodService\:\:parseContainerUrls\(\) expects string, mixed given\.$#' + identifier: argument.type + count: 1 + path: server/src/Services/PodService.php + + - + message: '#^Parameter \#1 \$profileData of method Fleetbase\\Solid\\Services\\PodService\:\:parseProfile\(\) expects string, mixed given\.$#' + identifier: argument.type + count: 1 + path: server/src/Services/PodService.php + + - + message: '#^Parameter \#1 \$url of method Fleetbase\\Solid\\Services\\PodService\:\:extractPodName\(\) expects string, mixed given\.$#' + identifier: argument.type + count: 2 + path: server/src/Services/PodService.php + + - + message: '#^Parameter \#1 \$webId of method Fleetbase\\Solid\\Services\\PodService\:\:getStorageUrlFromWebId\(\) expects string, mixed given\.$#' + identifier: argument.type + count: 2 + path: server/src/Services/PodService.php + + - + message: '#^Parameter \#2 \$content of method Fleetbase\\Solid\\Services\\PodService\:\:parsePodData\(\) expects string, mixed given\.$#' + identifier: argument.type + count: 1 + path: server/src/Services/PodService.php + + - + message: '#^Parameter \#2 \$subject of function preg_match expects string, mixed given\.$#' + identifier: argument.type + count: 1 + path: server/src/Services/PodService.php + + - + message: '#^Parameter \#2 \$uri of method Fleetbase\\Solid\\Models\\SolidIdentity\:\:request\(\) expects string, mixed given\.$#' + identifier: argument.type + count: 3 + path: server/src/Services/PodService.php + + - + message: '#^Undefined variable\: \$folderUrl$#' + identifier: variable.undefined + count: 1 + path: server/src/Services/PodService.php + + - + message: '#^Access to an undefined property Fleetbase\\Solid\\Models\\SolidIdentity\:\:\$webid\.$#' + identifier: property.notFound + count: 1 + path: server/src/Services/ResourceSyncService.php + + - + message: '#^Binary operation "\+\=" between \(float\|int\) and mixed results in an error\.$#' + identifier: assignOp.invalid + count: 1 + path: server/src/Services/ResourceSyncService.php + + - + message: '#^Binary operation "\." between non\-falsy\-string and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 2 + path: server/src/Services/ResourceSyncService.php + + - + message: '#^Cannot access property \$company_uuid on mixed\.$#' + identifier: property.nonObject + count: 1 + path: server/src/Services/ResourceSyncService.php + + - + message: '#^Cannot access property \$created_at on mixed\.$#' + identifier: property.nonObject + count: 4 + path: server/src/Services/ResourceSyncService.php + + - + message: '#^Cannot access property \$drivers_license_number on mixed\.$#' + identifier: property.nonObject + count: 1 + path: server/src/Services/ResourceSyncService.php + + - + message: '#^Cannot access property \$email on mixed\.$#' + identifier: property.nonObject + count: 2 + path: server/src/Services/ResourceSyncService.php + + - + message: '#^Cannot access property \$make on mixed\.$#' + identifier: property.nonObject + count: 1 + path: server/src/Services/ResourceSyncService.php + + - + message: '#^Cannot access property \$model on mixed\.$#' + identifier: property.nonObject + count: 1 + path: server/src/Services/ResourceSyncService.php + + - + message: '#^Cannot access property \$name on mixed\.$#' + identifier: property.nonObject + count: 3 + path: server/src/Services/ResourceSyncService.php + + - + message: '#^Cannot access property \$phone on mixed\.$#' + identifier: property.nonObject + count: 2 + path: server/src/Services/ResourceSyncService.php + + - + message: '#^Cannot access property \$plate_number on mixed\.$#' + identifier: property.nonObject + count: 1 + path: server/src/Services/ResourceSyncService.php + + - + message: '#^Cannot access property \$public_id on mixed\.$#' + identifier: property.nonObject + count: 5 + path: server/src/Services/ResourceSyncService.php + + - + message: '#^Cannot access property \$scheduled_at on mixed\.$#' + identifier: property.nonObject + count: 1 + path: server/src/Services/ResourceSyncService.php + + - + message: '#^Cannot access property \$status on mixed\.$#' + identifier: property.nonObject + count: 3 + path: server/src/Services/ResourceSyncService.php + + - + message: '#^Cannot access property \$type on mixed\.$#' + identifier: property.nonObject + count: 2 path: server/src/Services/ResourceSyncService.php - - message: "#^Method Fleetbase\\\\Solid\\\\Services\\\\ResourceSyncService\\:\\:importResources\\(\\) has parameter \\$resourceTypes with no value type specified in iterable type array\\.$#" + message: '#^Cannot access property \$updated_at on mixed\.$#' + identifier: property.nonObject + count: 4 + path: server/src/Services/ResourceSyncService.php + + - + message: '#^Cannot access property \$vin on mixed\.$#' + identifier: property.nonObject count: 1 path: server/src/Services/ResourceSyncService.php - - message: "#^Method Fleetbase\\\\Solid\\\\Services\\\\ResourceSyncService\\:\\:importResources\\(\\) return type has no value type specified in iterable type array\\.$#" + message: '#^Cannot access property \$year on mixed\.$#' + identifier: property.nonObject count: 1 path: server/src/Services/ResourceSyncService.php - - message: "#^Variable \\$resources in empty\\(\\) always exists and is not falsy\\.$#" + message: '#^Cannot call method all\(\) on mixed\.$#' + identifier: method.nonObject count: 1 path: server/src/Services/ResourceSyncService.php - - message: "#^Access to an undefined property Fleetbase\\\\FleetOps\\\\Models\\\\Vehicle\\:\\:\\$created_at\\.$#" + message: '#^Cannot call method body\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: server/src/Services/ResourceSyncService.php + + - + message: '#^Cannot call method count\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: server/src/Services/ResourceSyncService.php + + - + message: '#^Cannot call method ensureFolderPermissions\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: server/src/Services/ResourceSyncService.php + + - + message: '#^Cannot call method get\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: server/src/Services/ResourceSyncService.php + + - + message: '#^Cannot call method getBindings\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: server/src/Services/ResourceSyncService.php + + - + message: '#^Cannot call method limit\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: server/src/Services/ResourceSyncService.php + + - + message: '#^Cannot call method status\(\) on mixed\.$#' + identifier: method.nonObject + count: 2 + path: server/src/Services/ResourceSyncService.php + + - + message: '#^Cannot call method successful\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: server/src/Services/ResourceSyncService.php + + - + message: '#^Cannot call method toIso8601String\(\) on mixed\.$#' + identifier: method.nonObject + count: 9 + path: server/src/Services/ResourceSyncService.php + + - + message: '#^Cannot call method toSql\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: server/src/Services/ResourceSyncService.php + + - + message: '#^Cannot call method user\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: server/src/Services/ResourceSyncService.php + + - + message: '#^Cannot cast mixed to string\.$#' + identifier: cast.string + count: 1 + path: server/src/Services/ResourceSyncService.php + + - + message: '#^Function app not found\.$#' + identifier: function.notFound + count: 1 + path: server/src/Services/ResourceSyncService.php + + - + message: '#^Function auth not found\.$#' + identifier: function.notFound + count: 1 + path: server/src/Services/ResourceSyncService.php + + - + message: '#^Function session not found\.$#' + identifier: function.notFound + count: 2 + path: server/src/Services/ResourceSyncService.php + + - + message: '#^Method Fleetbase\\Solid\\Services\\ResourceSyncService\:\:convertToRDF\(\) has parameter \$resource with no type specified\.$#' + identifier: missingType.parameter + count: 1 + path: server/src/Services/ResourceSyncService.php + + - + message: '#^Method Fleetbase\\Solid\\Services\\ResourceSyncService\:\:formatRDFValue\(\) has parameter \$value with no type specified\.$#' + identifier: missingType.parameter + count: 1 + path: server/src/Services/ResourceSyncService.php + + - + message: '#^Method Fleetbase\\Solid\\Services\\ResourceSyncService\:\:getFleetopsResources\(\) should return Illuminate\\Support\\Collection but returns mixed\.$#' + identifier: return.type + count: 1 + path: server/src/Services/ResourceSyncService.php + + - + message: '#^Method Fleetbase\\Solid\\Services\\ResourceSyncService\:\:getResourceProperties\(\) has parameter \$resource with no type specified\.$#' + identifier: missingType.parameter + count: 1 + path: server/src/Services/ResourceSyncService.php + + - + message: '#^Method Fleetbase\\Solid\\Services\\ResourceSyncService\:\:getResourceProperties\(\) return type has no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: server/src/Services/ResourceSyncService.php + + - + message: '#^Method Fleetbase\\Solid\\Services\\ResourceSyncService\:\:importResourceType\(\) return type has no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: server/src/Services/ResourceSyncService.php + + - + message: '#^Method Fleetbase\\Solid\\Services\\ResourceSyncService\:\:importResources\(\) has parameter \$resourceTypes with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: server/src/Services/ResourceSyncService.php + + - + message: '#^Method Fleetbase\\Solid\\Services\\ResourceSyncService\:\:importResources\(\) return type has no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: server/src/Services/ResourceSyncService.php + + - + message: '#^Parameter \#3 \$resourceType of method Fleetbase\\Solid\\Services\\ResourceSyncService\:\:importResourceType\(\) expects string, mixed given\.$#' + identifier: argument.type + count: 1 + path: server/src/Services/ResourceSyncService.php + + - + message: '#^Part \$resource\-\>public_id \(mixed\) of encapsed string cannot be cast to string\.$#' + identifier: encapsedStringPart.nonString + count: 1 + path: server/src/Services/ResourceSyncService.php + + - + message: '#^Part \$response\-\>body\(\) \(mixed\) of encapsed string cannot be cast to string\.$#' + identifier: encapsedStringPart.nonString + count: 1 + path: server/src/Services/ResourceSyncService.php + + - + message: '#^Possibly invalid array key type mixed\.$#' + identifier: offsetAccess.invalidOffset + count: 2 + path: server/src/Services/ResourceSyncService.php + + - + message: '#^Variable \$resources in empty\(\) always exists and is not falsy\.$#' + identifier: empty.variable + count: 1 + path: server/src/Services/ResourceSyncService.php + + - + message: '#^Access to an undefined property Fleetbase\\FleetOps\\Models\\Vehicle\:\:\$created_at\.$#' + identifier: property.notFound count: 1 path: server/src/Services/VehicleSyncService.php - - message: "#^Access to an undefined property Fleetbase\\\\FleetOps\\\\Models\\\\Vehicle\\:\\:\\$driver\\.$#" + message: '#^Access to an undefined property Fleetbase\\FleetOps\\Models\\Vehicle\:\:\$driver\.$#' + identifier: property.notFound + count: 2 + path: server/src/Services/VehicleSyncService.php + + - + message: '#^Access to an undefined property Fleetbase\\FleetOps\\Models\\Vehicle\:\:\$location\.$#' + identifier: property.notFound count: 1 path: server/src/Services/VehicleSyncService.php - - message: "#^Access to an undefined property Fleetbase\\\\FleetOps\\\\Models\\\\Vehicle\\:\\:\\$location\\.$#" + message: '#^Access to an undefined property Fleetbase\\FleetOps\\Models\\Vehicle\:\:\$make\.$#' + identifier: property.notFound + count: 3 + path: server/src/Services/VehicleSyncService.php + + - + message: '#^Access to an undefined property Fleetbase\\FleetOps\\Models\\Vehicle\:\:\$model\.$#' + identifier: property.notFound + count: 3 + path: server/src/Services/VehicleSyncService.php + + - + message: '#^Access to an undefined property Fleetbase\\FleetOps\\Models\\Vehicle\:\:\$online\.$#' + identifier: property.notFound count: 1 path: server/src/Services/VehicleSyncService.php - - message: "#^Access to an undefined property Fleetbase\\\\FleetOps\\\\Models\\\\Vehicle\\:\\:\\$make\\.$#" + message: '#^Access to an undefined property Fleetbase\\FleetOps\\Models\\Vehicle\:\:\$plate_number\.$#' + identifier: property.notFound + count: 4 + path: server/src/Services/VehicleSyncService.php + + - + message: '#^Access to an undefined property Fleetbase\\FleetOps\\Models\\Vehicle\:\:\$status\.$#' + identifier: property.notFound count: 2 path: server/src/Services/VehicleSyncService.php - - message: "#^Access to an undefined property Fleetbase\\\\FleetOps\\\\Models\\\\Vehicle\\:\\:\\$model\\.$#" + message: '#^Access to an undefined property Fleetbase\\FleetOps\\Models\\Vehicle\:\:\$trim\.$#' + identifier: property.notFound count: 2 path: server/src/Services/VehicleSyncService.php - - message: "#^Access to an undefined property Fleetbase\\\\FleetOps\\\\Models\\\\Vehicle\\:\\:\\$online\\.$#" + message: '#^Access to an undefined property Fleetbase\\FleetOps\\Models\\Vehicle\:\:\$type\.$#' + identifier: property.notFound count: 1 path: server/src/Services/VehicleSyncService.php - - message: "#^Access to an undefined property Fleetbase\\\\FleetOps\\\\Models\\\\Vehicle\\:\\:\\$plate_number\\.$#" + message: '#^Access to an undefined property Fleetbase\\FleetOps\\Models\\Vehicle\:\:\$updated_at\.$#' + identifier: property.notFound + count: 2 + path: server/src/Services/VehicleSyncService.php + + - + message: '#^Access to an undefined property Fleetbase\\FleetOps\\Models\\Vehicle\:\:\$uuid\.$#' + identifier: property.notFound + count: 6 + path: server/src/Services/VehicleSyncService.php + + - + message: '#^Access to an undefined property Fleetbase\\FleetOps\\Models\\Vehicle\:\:\$vendor\.$#' + identifier: property.notFound + count: 2 + path: server/src/Services/VehicleSyncService.php + + - + message: '#^Access to an undefined property Fleetbase\\FleetOps\\Models\\Vehicle\:\:\$vin\.$#' + identifier: property.notFound + count: 3 + path: server/src/Services/VehicleSyncService.php + + - + message: '#^Access to an undefined property Fleetbase\\FleetOps\\Models\\Vehicle\:\:\$year\.$#' + identifier: property.notFound count: 3 path: server/src/Services/VehicleSyncService.php - - message: "#^Access to an undefined property Fleetbase\\\\FleetOps\\\\Models\\\\Vehicle\\:\\:\\$status\\.$#" + message: '#^Binary operation "\." between '' fleet\:syncedAt "'' and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: server/src/Services/VehicleSyncService.php + + - + message: '#^Binary operation "\." between ''Failed to store…'' and mixed results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: server/src/Services/VehicleSyncService.php + + - + message: '#^Cannot access offset ''coordinates'' on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible + count: 1 + path: server/src/Services/VehicleSyncService.php + + - + message: '#^Cannot access offset 0 on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible count: 1 path: server/src/Services/VehicleSyncService.php - - message: "#^Access to an undefined property Fleetbase\\\\FleetOps\\\\Models\\\\Vehicle\\:\\:\\$trim\\.$#" + message: '#^Cannot access offset 1 on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible + count: 1 + path: server/src/Services/VehicleSyncService.php + + - + message: '#^Cannot access property \$name on mixed\.$#' + identifier: property.nonObject + count: 4 + path: server/src/Services/VehicleSyncService.php + + - + message: '#^Cannot access property \$uuid on mixed\.$#' + identifier: property.nonObject count: 2 path: server/src/Services/VehicleSyncService.php - - message: "#^Access to an undefined property Fleetbase\\\\FleetOps\\\\Models\\\\Vehicle\\:\\:\\$type\\.$#" + message: '#^Cannot call method body\(\) on mixed\.$#' + identifier: method.nonObject count: 1 path: server/src/Services/VehicleSyncService.php - - message: "#^Access to an undefined property Fleetbase\\\\FleetOps\\\\Models\\\\Vehicle\\:\\:\\$updated_at\\.$#" + message: '#^Cannot call method diffForHumans\(\) on mixed\.$#' + identifier: method.nonObject count: 1 path: server/src/Services/VehicleSyncService.php - - message: "#^Access to an undefined property Fleetbase\\\\FleetOps\\\\Models\\\\Vehicle\\:\\:\\$uuid\\.$#" - count: 5 + message: '#^Cannot call method status\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 path: server/src/Services/VehicleSyncService.php - - message: "#^Access to an undefined property Fleetbase\\\\FleetOps\\\\Models\\\\Vehicle\\:\\:\\$vendor\\.$#" + message: '#^Cannot call method successful\(\) on mixed\.$#' + identifier: method.nonObject count: 1 path: server/src/Services/VehicleSyncService.php - - message: "#^Access to an undefined property Fleetbase\\\\FleetOps\\\\Models\\\\Vehicle\\:\\:\\$vin\\.$#" - count: 2 + message: '#^Cannot call method toISOString\(\) on mixed\.$#' + identifier: method.nonObject + count: 3 + path: server/src/Services/VehicleSyncService.php + + - + message: '#^Dead catch \- Throwable is never thrown in the try block\.$#' + identifier: catch.neverThrown + count: 1 path: server/src/Services/VehicleSyncService.php - - message: "#^Access to an undefined property Fleetbase\\\\FleetOps\\\\Models\\\\Vehicle\\:\\:\\$year\\.$#" + message: '#^Function now not found\.$#' + identifier: function.notFound + count: 1 + path: server/src/Services/VehicleSyncService.php + + - + message: '#^Function session not found\.$#' + identifier: function.notFound count: 2 path: server/src/Services/VehicleSyncService.php - - message: "#^Access to an undefined property Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:\\$driver\\.$#" + message: '#^Method Fleetbase\\Solid\\Services\\VehicleSyncService\:\:getAvailableVehicles\(\) return type has no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue count: 1 path: server/src/Services/VehicleSyncService.php - - message: "#^Access to an undefined property Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:\\$make\\.$#" + message: '#^Method Fleetbase\\Solid\\Services\\VehicleSyncService\:\:getSyncStatus\(\) return type has no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue count: 1 path: server/src/Services/VehicleSyncService.php - - message: "#^Access to an undefined property Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:\\$model\\.$#" + message: '#^Method Fleetbase\\Solid\\Services\\VehicleSyncService\:\:syncVehiclesToPod\(\) has parameter \$vehicleIds with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue count: 1 path: server/src/Services/VehicleSyncService.php - - message: "#^Access to an undefined property Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:\\$plate_number\\.$#" + message: '#^Method Fleetbase\\Solid\\Services\\VehicleSyncService\:\:syncVehiclesToPod\(\) return type has no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue count: 1 path: server/src/Services/VehicleSyncService.php - - message: "#^Access to an undefined property Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:\\$status\\.$#" + message: '#^Parameter \#1 \$callback of method Illuminate\\Database\\Eloquent\\Collection\\:\:map\(\) contains unresolvable type\.$#' + identifier: argument.unresolvableType count: 1 path: server/src/Services/VehicleSyncService.php - - message: "#^Access to an undefined property Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:\\$updated_at\\.$#" + message: '#^Parameter \#1 \$title of static method Illuminate\\Support\\Str\:\:slug\(\) expects string, mixed given\.$#' + identifier: argument.type count: 1 path: server/src/Services/VehicleSyncService.php - - message: "#^Access to an undefined property Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:\\$uuid\\.$#" + message: '#^Parameter \#2 \$array of function implode expects array\, array\ given\.$#' + identifier: argument.type count: 1 path: server/src/Services/VehicleSyncService.php - - message: "#^Access to an undefined property Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:\\$vendor\\.$#" + message: '#^Parameter \#3 \$vehicle of method Fleetbase\\Solid\\Services\\VehicleSyncService\:\:syncSingleVehicle\(\) expects Fleetbase\\FleetOps\\Models\\Vehicle, stdClass given\.$#' + identifier: argument.type count: 1 path: server/src/Services/VehicleSyncService.php - - message: "#^Access to an undefined property Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:\\$vin\\.$#" + message: '#^Part \$coords\[0\] \(mixed\) of encapsed string cannot be cast to string\.$#' + identifier: encapsedStringPart.nonString count: 1 path: server/src/Services/VehicleSyncService.php - - message: "#^Access to an undefined property Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:\\$year\\.$#" + message: '#^Part \$coords\[1\] \(mixed\) of encapsed string cannot be cast to string\.$#' + identifier: encapsedStringPart.nonString count: 1 path: server/src/Services/VehicleSyncService.php - - message: "#^Cannot access property \\$uuid on mixed\\.$#" - count: 3 + message: '#^Part \$vehicle\-\>created_at\-\>toISOString\(\) \(mixed\) of encapsed string cannot be cast to string\.$#' + identifier: encapsedStringPart.nonString + count: 1 + path: server/src/Services/VehicleSyncService.php + + - + message: '#^Part \$vehicle\-\>driver\-\>name \(mixed\) of encapsed string cannot be cast to string\.$#' + identifier: encapsedStringPart.nonString + count: 1 path: server/src/Services/VehicleSyncService.php - - message: "#^Cannot call method map\\(\\) on array\\\\|Illuminate\\\\Database\\\\Eloquent\\\\Collection\\.$#" + message: '#^Part \$vehicle\-\>driver\-\>uuid \(mixed\) of encapsed string cannot be cast to string\.$#' + identifier: encapsedStringPart.nonString count: 1 path: server/src/Services/VehicleSyncService.php - - message: "#^Dead catch \\- Throwable is never thrown in the try block\\.$#" + message: '#^Part \$vehicle\-\>make \(mixed\) of encapsed string cannot be cast to string\.$#' + identifier: encapsedStringPart.nonString count: 1 path: server/src/Services/VehicleSyncService.php - - message: "#^Function now not found\\.$#" + message: '#^Part \$vehicle\-\>model \(mixed\) of encapsed string cannot be cast to string\.$#' + identifier: encapsedStringPart.nonString count: 1 path: server/src/Services/VehicleSyncService.php - - message: "#^Function session not found\\.$#" + message: '#^Part \$vehicle\-\>plate_number \(mixed\) of encapsed string cannot be cast to string\.$#' + identifier: encapsedStringPart.nonString count: 2 path: server/src/Services/VehicleSyncService.php - - message: "#^Method Fleetbase\\\\Solid\\\\Services\\\\VehicleSyncService\\:\\:getAvailableVehicles\\(\\) return type has no value type specified in iterable type array\\.$#" + message: '#^Part \$vehicle\-\>status \(mixed\) of encapsed string cannot be cast to string\.$#' + identifier: encapsedStringPart.nonString count: 1 path: server/src/Services/VehicleSyncService.php - - message: "#^Method Fleetbase\\\\Solid\\\\Services\\\\VehicleSyncService\\:\\:getSyncStatus\\(\\) return type has no value type specified in iterable type array\\.$#" + message: '#^Part \$vehicle\-\>trim \(mixed\) of encapsed string cannot be cast to string\.$#' + identifier: encapsedStringPart.nonString count: 1 path: server/src/Services/VehicleSyncService.php - - message: "#^Method Fleetbase\\\\Solid\\\\Services\\\\VehicleSyncService\\:\\:syncVehiclesToPod\\(\\) has parameter \\$vehicleIds with no value type specified in iterable type array\\.$#" + message: '#^Part \$vehicle\-\>type \(mixed\) of encapsed string cannot be cast to string\.$#' + identifier: encapsedStringPart.nonString count: 1 path: server/src/Services/VehicleSyncService.php - - message: "#^Method Fleetbase\\\\Solid\\\\Services\\\\VehicleSyncService\\:\\:syncVehiclesToPod\\(\\) return type has no value type specified in iterable type array\\.$#" + message: '#^Part \$vehicle\-\>updated_at\-\>toISOString\(\) \(mixed\) of encapsed string cannot be cast to string\.$#' + identifier: encapsedStringPart.nonString count: 1 path: server/src/Services/VehicleSyncService.php - - message: "#^Parameter \\#1 \\$vehicle of method Fleetbase\\\\Solid\\\\Services\\\\VehicleSyncService\\:\\:getVehicleDisplayName\\(\\) expects Fleetbase\\\\FleetOps\\\\Models\\\\Vehicle, Illuminate\\\\Database\\\\Eloquent\\\\Model given\\.$#" + message: '#^Part \$vehicle\-\>uuid \(mixed\) of encapsed string cannot be cast to string\.$#' + identifier: encapsedStringPart.nonString + count: 3 + path: server/src/Services/VehicleSyncService.php + + - + message: '#^Part \$vehicle\-\>vendor\-\>name \(mixed\) of encapsed string cannot be cast to string\.$#' + identifier: encapsedStringPart.nonString + count: 1 + path: server/src/Services/VehicleSyncService.php + + - + message: '#^Part \$vehicle\-\>vendor\-\>uuid \(mixed\) of encapsed string cannot be cast to string\.$#' + identifier: encapsedStringPart.nonString + count: 1 + path: server/src/Services/VehicleSyncService.php + + - + message: '#^Part \$vehicle\-\>vin \(mixed\) of encapsed string cannot be cast to string\.$#' + identifier: encapsedStringPart.nonString + count: 1 + path: server/src/Services/VehicleSyncService.php + + - + message: '#^Part \$vehicle\-\>year \(mixed\) of encapsed string cannot be cast to string\.$#' + identifier: encapsedStringPart.nonString count: 1 path: server/src/Services/VehicleSyncService.php - - message: "#^Parameter \\#3 \\$vehicle of method Fleetbase\\\\Solid\\\\Services\\\\VehicleSyncService\\:\\:syncSingleVehicle\\(\\) expects Fleetbase\\\\FleetOps\\\\Models\\\\Vehicle, mixed given\\.$#" + message: '#^Return type of call to method Illuminate\\Database\\Eloquent\\Collection\\:\:map\(\) contains unresolvable type\.$#' + identifier: method.unresolvableReturnType count: 1 path: server/src/Services/VehicleSyncService.php - - message: "#^Deprecated in PHP 8\\.0\\: Required parameter \\$key follows optional parameter \\$data\\.$#" + message: '#^Deprecated in PHP 8\.0\: Required parameter \$key follows optional parameter \$data\.$#' + identifier: parameter.requiredAfterOptional count: 1 path: server/src/Support/Utils.php - - message: "#^Deprecated in PHP 8\\.0\\: Required parameter \\$value follows optional parameter \\$data\\.$#" + message: '#^Deprecated in PHP 8\.0\: Required parameter \$value follows optional parameter \$data\.$#' + identifier: parameter.requiredAfterOptional count: 1 path: server/src/Support/Utils.php - - message: "#^Method Fleetbase\\\\Solid\\\\Support\\\\Utils\\:\\:searchPods\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#" + message: '#^Method Fleetbase\\Solid\\Support\\Utils\:\:searchPods\(\) has parameter \$data with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue count: 1 path: server/src/Support/Utils.php - - message: "#^Parameter \\#1 \\$data of static method Fleetbase\\\\Solid\\\\Support\\\\Utils\\:\\:searchPods\\(\\) expects array, mixed given\\.$#" + message: '#^Parameter \#1 \$data of static method Fleetbase\\Solid\\Support\\Utils\:\:searchPods\(\) expects array, mixed given\.$#' + identifier: argument.type count: 1 path: server/src/Support/Utils.php - - message: "#^Parameter \\#1 \\$string of function strtolower expects string, mixed given\\.$#" + message: '#^Parameter \#1 \$string of function strtolower expects string, mixed given\.$#' + identifier: argument.type count: 1 path: server/src/Support/Utils.php - - message: "#^Parameter \\#1 \\$string1 of function strcasecmp expects string, mixed given\\.$#" + message: '#^Parameter \#1 \$string1 of function strcasecmp expects string, mixed given\.$#' + identifier: argument.type count: 1 path: server/src/Support/Utils.php - - message: "#^Function config not found\\.$#" + message: '#^Cannot call method any\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: server/src/routes.php + + - + message: '#^Cannot call method delete\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: server/src/routes.php + + - + message: '#^Cannot call method get\(\) on mixed\.$#' + identifier: method.nonObject + count: 7 + path: server/src/routes.php + + - + message: '#^Cannot call method group\(\) on mixed\.$#' + identifier: method.nonObject + count: 4 + path: server/src/routes.php + + - + message: '#^Cannot call method post\(\) on mixed\.$#' + identifier: method.nonObject + count: 4 + path: server/src/routes.php + + - + message: '#^Cannot call method prefix\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: server/src/routes.php + + - + message: '#^Function config not found\.$#' + identifier: function.notFound count: 2 path: server/src/routes.php + + - + message: '#^Parameter \#1 \$prefix of static method Illuminate\\Support\\Facades\\Route\:\:prefix\(\) expects string, mixed given\.$#' + identifier: argument.type + count: 1 + path: server/src/routes.php diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 27f5644..da84785 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -16,6 +16,8 @@ parameters: paths: - server/src - checkMissingIterableValueType: true - checkGenericClassInNonGenericObjectType: false reportUnmatchedIgnoredErrors: true + # PHPStan 2 always checks iterable value types and dropped the generics switch; + # this identifier is what checkGenericClassInNonGenericObjectType: false used to skip. + ignoreErrors: + - identifier: missingType.generics diff --git a/server/src/Http/Controllers/SolidController.php b/server/src/Http/Controllers/SolidController.php index 490daa3..89ea58f 100644 --- a/server/src/Http/Controllers/SolidController.php +++ b/server/src/Http/Controllers/SolidController.php @@ -46,7 +46,7 @@ public function getServerConfig(AdminRequest $request) public function saveServerConfig(AdminRequest $request) { - $incomingConfig = $request->array('server'); + $incomingConfig = $request->inputArray('server'); $defaultConfig = config('solid.server'); $config = array_merge($defaultConfig, $incomingConfig); Setting::configure('system.solid.server', $config); diff --git a/server/tests/Unit/SolidControllerServerConfigTest.php b/server/tests/Unit/SolidControllerServerConfigTest.php new file mode 100644 index 0000000..c3cda57 --- /dev/null +++ b/server/tests/Unit/SolidControllerServerConfigTest.php @@ -0,0 +1,126 @@ +make("config"); return $key === null ? $config : $config->get($key, $default); }'); +} +if (!function_exists('response')) { + eval('function response() { return \Illuminate\Container\Container::getInstance()->make(\Illuminate\Contracts\Routing\ResponseFactory::class); }'); +} + +/** + * Saving the Solid server settings from the admin console. + * + * The request's `server` input is read with core-api's `inputArray()` macro, because + * Laravel 11+ ships a native `Request::array()` that would shadow a macro of that name. + * The saved value is the defaults with the request's values on top. + */ +class SolidControllerServerConfigTest extends TestCase +{ + private Capsule $capsule; + + protected function setUp(): void + { + parent::setUp(); + + $container = new Container(); + Container::setInstance($container); + Facade::setFacadeApplication($container); + + $container->instance('config', new Repository([ + 'solid' => ['server' => ['host' => 'http://solid', 'port' => 3000, 'secure' => false]], + ])); + $container->instance(ResponseFactory::class, new class { + public function json($data = [], $status = 200, array $headers = [], $options = 0): JsonResponse + { + return new JsonResponse($data, $status, $headers, $options); + } + }); + + // Settings write to the `mysql` connection by default; here that is in-memory SQLite. + $this->capsule = new Capsule($container); + $this->capsule->addConnection(['driver' => 'sqlite', 'database' => ':memory:', 'prefix' => ''], 'mysql'); + $this->capsule->setAsGlobal(); + $this->capsule->bootEloquent(); + $container->instance('db', $this->capsule->getDatabaseManager()); + $this->capsule->schema('mysql')->create('settings', function ($table) { + $table->increments('id'); + $table->string('key')->unique(); + $table->text('value')->nullable(); + }); + + Request::macro('inputArray', (new RequestExpansion())->inputArray()); + } + + protected function tearDown(): void + { + Model::unsetConnectionResolver(); + Request::flushMacros(); + Facade::clearResolvedInstances(); + Facade::setFacadeApplication(null); + Container::setInstance(null); + + parent::tearDown(); + } + + public function testSavingTheServerConfigMergesTheRequestOverTheDefaultsAndStoresIt(): void + { + $response = $this->controller()->saveServerConfig($this->request(['server' => ['host' => 'https://pods.example', 'secure' => true]])); + + $expected = ['host' => 'https://pods.example', 'port' => 3000, 'secure' => true]; + $this->assertSame($expected, $response->getData(true)); + // Setting's value is cast from JSON, so the stored row reads back as the array. + $this->assertSame($expected, Setting::where('key', 'system.solid.server')->value('value')); + } + + public function testARequestWithoutServerSettingsStoresTheDefaults(): void + { + $response = $this->controller()->saveServerConfig($this->request([])); + + $this->assertSame(['host' => 'http://solid', 'port' => 3000, 'secure' => false], $response->getData(true)); + $this->assertSame(1, Setting::where('key', 'system.solid.server')->count()); + } + + private function controller(): SolidController + { + // The pod service isn't used to save settings, and building it needs a Solid server. + return (new \ReflectionClass(SolidController::class))->newInstanceWithoutConstructor(); + } + + private function request(array $input): AdminRequest + { + return AdminRequest::create('/solid/int/v1/server-config', 'POST', $input); + } +}