Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .php-cs-fixer.cache
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"php":"8.1.34","version":"3.94.2:v3.94.2#7787ceff91365ba7d623ec410b8f429cdebb4f63","indent":" ","lineEnding":"\n","rules":{"binary_operator_spaces":true,"blank_line_after_opening_tag":true,"blank_line_between_import_groups":true,"blank_lines_before_namespace":true,"braces_position":{"allow_single_line_anonymous_functions":false,"allow_single_line_empty_anonymous_classes":true},"class_definition":{"inline_constructor_arguments":false,"space_before_parenthesis":true},"compact_nullable_type_declaration":true,"declare_equal_normalize":true,"lowercase_cast":true,"lowercase_static_reference":true,"modifier_keywords":true,"new_with_parentheses":{"anonymous_class":true},"no_blank_lines_after_class_opening":true,"no_extra_blank_lines":{"tokens":["use"]},"no_leading_import_slash":true,"no_whitespace_in_blank_line":true,"ordered_class_elements":{"order":["use_trait"]},"ordered_imports":{"sort_algorithm":"alpha"},"return_type_declaration":true,"short_scalar_cast":true,"single_import_per_statement":{"group_to_single_imports":false},"single_space_around_construct":{"constructs_followed_by_a_single_space":["abstract","as","case","catch","class","const_import","do","else","elseif","final","finally","for","foreach","function","function_import","if","insteadof","interface","namespace","new","private","protected","public","static","switch","trait","try","use","use_lambda","while"],"constructs_preceded_by_a_single_space":["as","else","elseif","use_lambda"]},"single_trait_insert_per_statement":true,"ternary_operator_spaces":true,"unary_operator_spaces":true,"blank_line_after_namespace":true,"constant_case":true,"control_structure_braces":true,"control_structure_continuation_position":true,"elseif":true,"function_declaration":{"closure_fn_spacing":"one"},"indentation_type":true,"line_ending":true,"lowercase_keywords":true,"method_argument_space":{"on_multiline":"ensure_fully_multiline","keep_multiple_spaces_after_comma":true},"no_break_comment":true,"no_closing_tag":true,"no_multiple_statements_per_line":true,"no_space_around_double_colon":true,"no_spaces_after_function_name":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_class_element_per_statement":{"elements":["property"]},"single_line_after_imports":true,"spaces_inside_parentheses":true,"statement_indentation":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"encoding":true,"full_opening_tag":true,"array_syntax":{"syntax":"short"},"no_unused_imports":true,"not_operator_with_successor_space":true,"trailing_comma_in_multiline":true,"phpdoc_scalar":true,"blank_line_before_statement":{"statements":["break","continue","declare","return","throw","try"]},"phpdoc_single_line_var_spacing":true,"phpdoc_var_without_name":true,"class_attributes_separation":{"elements":{"method":"one"}}},"ruleCustomisationPolicyVersion":"null-policy","hashes":{"tests\/SubaccountTest.php":"6da25190c6f06ac14886cd0f20d2dbd8","tests\/PaystackTest.php":"665cdc4a95646b0bf2bbdf73707cfe79","src\/Contracts\/HttpClientInterface.php":"4446b6de71336902bd676e72ffd0bee2","src\/Resources\/Subscription.php":"841db8deb5500da26cf03b24931c935b","src\/Resources\/Transaction.php":"d7cccd52c692d5f343a71516c431a4e2","src\/Resources\/Verification.php":"d4c30249cfef6cb704e5f520699f9daa","src\/Resources\/Refund.php":"44968d9f0a1b4417c1b7e046cb8c5be1","src\/Resources\/ApiResource.php":"10e9814e2132a7bef15e8a76efa104dc","src\/Resources\/Settlement.php":"befa2c48309a4979cbc78275a04263af","src\/Resources\/Transfer.php":"2e1e3413d7a3b4fd1d5bb84aab9618d2","src\/Resources\/Customer.php":"8f15a9e343b391cfc222e0f9cce2dd81","src\/Resources\/Miscellaneous.php":"933f9b255a624da08eb638dc8aea9a1d","src\/Resources\/Split.php":"d0e8699fc8d7a98b3e74255d017c2ef6","src\/Resources\/Subaccount.php":"bea16e577daf6d856eb76400d22771de","src\/Resources\/Plan.php":"aa01d044a604613b7e782ee43c862625","src\/Exceptions\/PaystackException.php":"aa9195efe9278d2d3c13a36e227e6447","src\/Http\/PsrHttpClient.php":"05a2f952c71ec3d9e0a760e110a6fff0","src\/Paystack.php":"62205ea63e46b6d465bdb143ec322dbb","src\/Laravel\/PaystackServiceProvider.php":"ac969d27b193c453ac117f80b893ccdb","src\/Laravel\/Facades\/Paystack.php":"205c2a2834641b0454a017020defbf66","tests\/VerificationTest.php":"e0c12bdbcab561a0354304fa0e7e15e7","tests\/RefundTest.php":"c19490e65841a823089b7f9d78abb57e","tests\/TransferTest.php":"9d2b5a8d3ec7aee33ddc0aec0606d8bf","tests\/SplitTest.php":"6eb61af0133d41608f0b77629b24595b","tests\/MiscellaneousTest.php":"152391a1ca2b1195f73c1c8ac85aa9c5","tests\/SubscriptionTest.php":"a1c2203afcba9500774013e648801e77","tests\/ResourceTestCase.php":"ac1151aa457e3921576b7d72cf9e7847","tests\/TransactionTest.php":"da78f818365b83a3c61adc815e78ce11","tests\/PlanTest.php":"786af4cfcfc269d3846accfc4b4e6aca","tests\/CustomerTest.php":"f54aa2f60fcdc254acddb069afa3a1da","tests\/LaravelIntegrationTest.php":"141139b5b2845b5572953c5088d31a69","tests\/SettlementTest.php":"76cb7577dfc27cf59ce1d82a0dac63af"}}
39 changes: 39 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php

$finder = PhpCsFixer\Finder::create()
->in([
__DIR__ . '/src',
__DIR__ . '/tests',
])
->name('*.php')
->ignoreDotFiles(true)
->ignoreVCS(true);

$config = new PhpCsFixer\Config();
return $config->setRules([
'@PSR12' => true,
'array_syntax' => ['syntax' => 'short'],
'ordered_imports' => ['sort_algorithm' => 'alpha'],
'no_unused_imports' => true,
'not_operator_with_successor_space' => true,
'trailing_comma_in_multiline' => true,
'phpdoc_scalar' => true,
'unary_operator_spaces' => true,
'binary_operator_spaces' => true,
'blank_line_before_statement' => [
'statements' => ['break', 'continue', 'declare', 'return', 'throw', 'try'],
],
'phpdoc_single_line_var_spacing' => true,
'phpdoc_var_without_name' => true,
'class_attributes_separation' => [
'elements' => [
'method' => 'one',
],
],
'method_argument_space' => [
'on_multiline' => 'ensure_fully_multiline',
'keep_multiple_spaces_after_comma' => true,
],
'single_trait_insert_per_statement' => true,
])
->setFinder($finder);
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added
- Docker environment for development (`Dockerfile`, `docker-compose.yml`, `Makefile`).
- Docker usage instructions to `README.md`.

### Changed
- Updated `README.md` with detailed installation and usage instructions.
- Replaced `laravel/pint` with `friendsofphp/php-cs-fixer` and `phpstan/phpstan` for linting and formatting.

### Removed
- Laravel support (Service Provider, Facade, and `illuminate/support` dependency).
48 changes: 48 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
FROM php:8.1-cli-alpine

# Install system dependencies
RUN apk add --no-cache \
git \
unzip \
libzip-dev \
autoconf \
g++ \
make \
linux-headers

# Install PHP extensions
RUN docker-php-ext-install zip pcntl

# Install Xdebug
RUN pecl install xdebug \
&& docker-php-ext-enable xdebug

# Install Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer

# Configure Xdebug
RUN echo "xdebug.mode=debug,develop" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
&& echo "xdebug.client_host=host.docker.internal" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
&& echo "xdebug.start_with_request=yes" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
&& echo "xdebug.discover_client_host=yes" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
&& echo "xdebug.idekey=PHPSTORM" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini

# Set working directory
WORKDIR /app

# Copy composer files for better caching
COPY composer.json composer.lock* ./

# Install dependencies
RUN composer install --no-scripts --no-autoloader

# Copy project files
COPY . .

# Finish composer setup
RUN composer dump-autoload --optimize

# Expose port for PHP built-in server (examples)
EXPOSE 8000

CMD ["php", "-S", "0.0.0.0:8000", "-t", "examples"]
31 changes: 31 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
.PHONY: help install test lint format up down build logs shell

help: ## Show this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'

install: ## Install composer dependencies locally
composer install

test: ## Run PHPUnit tests
composer test

lint: ## Run static analysis (PHPStan)
composer lint

format: ## Automatically fix code style issues
composer format

up: ## Start the Docker environment
docker-compose up -d

down: ## Stop the Docker environment
docker-compose down

build: ## Build/rebuild the Docker image
docker-compose up -d --build

logs: ## Follow Docker logs
docker-compose logs -f app

shell: ## Access the app container shell
docker-compose exec app sh
Loading
Loading