Skip to content

Commit

Permalink
Merge pull request #9 from huntmori/main
Browse files Browse the repository at this point in the history
pr
  • Loading branch information
huntmori authored Jan 5, 2024
2 parents 92040a7 + 3d3acf4 commit 9d03535
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 58 deletions.
16 changes: 8 additions & 8 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
version: 2
updates:
- package-ecosystem: composer
directory: "/"
schedule:
interval: monthly
open-pull-requests-limit: 10
versioning-strategy: increase
#version: 2
#updates:
#- package-ecosystem: composer
# directory: "/"
# schedule:
# interval: monthly
# open-pull-requests-limit: 10
# versioning-strategy: increase
98 changes: 49 additions & 49 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,49 +1,49 @@
name: Tests

on: [push, pull_request]

jobs:
tests:
name: Tests PHP ${{ matrix.php }}
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
php: [7.4, 8.0, 8.1]
experimental: [false]
include:
- php: 8.1
analysis: true

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: xdebug

- name: Install dependencies with Composer
uses: ramsey/composer-install@v2

- name: Coding standards
if: matrix.analysis
run: vendor/bin/phpcs

- name: Static analysis
if: matrix.analysis
run: vendor/bin/phpstan

- name: Tests
run: vendor/bin/phpunit --coverage-clover clover.xml

- name: Upload coverage results to Coveralls
if: matrix.analysis
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
composer require php-coveralls/php-coveralls -n -W
vendor/bin/php-coveralls --coverage_clover=clover.xml -v
#name: Tests
#
#on: [push, pull_request]
#
#jobs:
# tests:
# name: Tests PHP ${{ matrix.php }}
# runs-on: ubuntu-latest
# continue-on-error: ${{ matrix.experimental }}
# strategy:
# fail-fast: false
# matrix:
# php: [7.4, 8.0, 8.1]
# experimental: [false]
# include:
# - php: 8.1
# analysis: true
#
# steps:
# - name: Checkout
# uses: actions/checkout@v2
#
# - name: Set up PHP ${{ matrix.php }}
# uses: shivammathur/setup-php@v2
# with:
# php-version: ${{ matrix.php }}
# coverage: xdebug
#
# - name: Install dependencies with Composer
# uses: ramsey/composer-install@v2
#
# - name: Coding standards
# if: matrix.analysis
# run: vendor/bin/phpcs
#
# - name: Static analysis
# if: matrix.analysis
# run: vendor/bin/phpstan
#
# - name: Tests
# run: vendor/bin/phpunit --coverage-clover clover.xml
#
# - name: Upload coverage results to Coveralls
# if: matrix.analysis
# env:
# COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: |
# composer require php-coveralls/php-coveralls -n -W
# vendor/bin/php-coveralls --coverage_clover=clover.xml -v
2 changes: 1 addition & 1 deletion public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ function(ServerRequestInterface $request) use ($app, $port) {

$serverInfos[] = $serverInfo;

echo $maxPort. "is open ".PHP_EOL;
echo $maxPort. " 8i open ".PHP_EOL;
} else {
echo $maxPort. "is already used. it will be skipped".PHP_EOL;
}
Expand Down
12 changes: 12 additions & 0 deletions src/Domain/User/entities/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class User implements JsonSerializable

private ?int $idx;
private ?string $id;
private ?string $uid;
private ?string $email;
private ?string $userName;
private ?string $password;
Expand All @@ -32,6 +33,7 @@ public function get($keyName) {
public array $columnMapping = [
'idx'=>'idx',
'id'=>'id',
'uid'=>'uid',
'email'=>'email',
'userName'=>'user_name',
'password'=>'password',
Expand Down Expand Up @@ -71,6 +73,16 @@ public function setId(?string $id): void
$this->id = $id;
}

public function getUid() : ?string
{
return $this->uid;
}

public function setUid(string $uid) : void
{
$this->uid = $uid;
}

public function getEmail(): ?string
{
return $this->email;
Expand Down
3 changes: 3 additions & 0 deletions src/Domain/User/repository/UserRepositoryImplement.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public function createUser(User $user) : int
$stmt = $pdo->prepare("
INSERT INTO user
SET id = :id,
uid = upper(UUID()),
email = :email,
user_name = :userName,
password = :password,
Expand Down Expand Up @@ -72,6 +73,7 @@ public function findUserOfIdx(int $idx): User
$stmt = $pdo->prepare("
SELECT idx,
id,
uid,
email,
password,
created_at as createdAt,
Expand All @@ -93,6 +95,7 @@ public function findUserOfUserId(string $user): ?User
$stmt = $pdo->prepare("
SELECT idx,
id,
uid,
email,
user_name as userName,
password,
Expand Down

0 comments on commit 9d03535

Please sign in to comment.