Skip to content

Commit 575e3bc

Browse files
authored
Merge pull request #12 from microsoft/feat/kiota-bundle
feat: add kiota bundle
2 parents 1880226 + 4d547ec commit 575e3bc

21 files changed

+647
-5
lines changed

.github/workflows/build.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ jobs:
3838
'serialization/json',
3939
'serialization/text',
4040
'serialization/form',
41-
'serialization/multipart'
41+
'serialization/multipart',
42+
'bundle'
4243
]
4344
php-versions: ['7.4', '8.0', '8.1', '8.2', '8.3']
4445
steps:
@@ -70,7 +71,8 @@ jobs:
7071
'serialization/json',
7172
'serialization/text',
7273
'serialization/form',
73-
'serialization/multipart'
74+
'serialization/multipart',
75+
'bundle'
7476
]
7577
steps:
7678
- name: Checkout

packages/bundle/.editorconfig

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# top-most EditorConfig file
2+
root = true
3+
4+
# All PHP files MUST use the Unix LF (linefeed) line ending.
5+
# Code MUST use an indent of 4 spaces, and MUST NOT use tabs for indenting.
6+
# All PHP files MUST end with a single blank line.
7+
# There MUST NOT be trailing whitespace at the end of non-blank lines.
8+
[*]
9+
charset = utf-8
10+
end_of_line = lf
11+
insert_final_newline = true
12+
trim_trailing_whitespace = true
13+
14+
# PHP-Files, Composer.json, MD-Files
15+
[{*.php,composer.json,*.md}]
16+
indent_style = space
17+
indent_size = 4
18+
19+
# HTML-Files LESS-Files SASS-Files CSS-Files JS-Files JSON-Files
20+
[{*.html,*.less,*.sass,*.css,*.js,*.json}]
21+
indent_style = tab
22+
indent_size = 4
23+
24+
# Gitlab-CI, Travis-CI
25+
[*.yml]
26+
indent_style = space
27+
indent_size = 2

packages/bundle/.gitattributes

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
* text=auto eol=lf
2+
*.{png,jpg,jpeg,gif,webp,woff,woff2} binary
3+
/coverage export-ignore
4+
/docs export-ignore
5+
/vendor export-ignore
6+
.gitattributes export-ignore
7+
.gitignore export-ignore
8+
/.github export-ignore
9+
/tests export-ignore
10+
phpstan.neon export-ignore
11+
phpunit.xml export-ignore
12+
sonar-project.properties export-ignore

packages/bundle/.github/CODEOWNERS

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @microsoft/kiota-write
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Copyright (c) Microsoft Corporation.
2+
# Licensed under the MIT License.
3+
4+
name: kiota-bundle-php-branch-protection
5+
description: Branch protection policy for the kiota-bundle-php repository
6+
resource: repository
7+
configuration:
8+
branchProtectionRules:
9+
10+
- branchNamePattern: main
11+
# Specifies whether this branch can be deleted. boolean
12+
allowsDeletions: false
13+
# Specifies whether forced pushes are allowed on this branch. boolean
14+
allowsForcePushes: false
15+
# Specifies whether new commits pushed to the matching branches dismiss pull request review approvals. boolean
16+
dismissStaleReviews: true
17+
# Specifies whether admins can overwrite branch protection. boolean
18+
isAdminEnforced: false
19+
# Indicates whether "Require a pull request before merging" is enabled. boolean
20+
requiresPullRequestBeforeMerging: true
21+
# Specifies the number of pull request reviews before merging. int (0-6). Should be null/empty if PRs are not required
22+
requiredApprovingReviewsCount: 1
23+
# Require review from Code Owners. Requires requiredApprovingReviewsCount. boolean
24+
requireCodeOwnersReview: true
25+
# Are commits required to be signed. boolean. TODO: all contributors must have commit signing on local machines.
26+
requiresCommitSignatures: false
27+
# Are conversations required to be resolved before merging? boolean
28+
requiresConversationResolution: true
29+
# Are merge commits prohibited from being pushed to this branch. boolean
30+
requiresLinearHistory: false
31+
# Required status checks to pass before merging. Values can be any string, but if the value does not correspond to any existing status check, the status check will be stuck on pending for status since nothing exists to push an actual status
32+
requiredStatusChecks:
33+
- license/cla
34+
# Require branches to be up to date before merging. This should be false since the repo contains autogenerated files. boolean
35+
requiresStrictStatusChecks: false
36+
# Indicates whether there are restrictions on who can push. boolean. Should be set with whoCanPush.
37+
restrictsPushes: false
38+
# Restrict who can dismiss pull request reviews. boolean
39+
restrictsReviewDismissals: false

packages/bundle/.gitignore

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
composer.phar
2+
composer.lock
3+
/vendor/
4+
/coverage
5+
.idea/
6+
tests/Functional/TestConstants.php
7+
.phpunit.result.cache
8+
.phpdoc/
9+
coverage.xml

packages/bundle/CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Changelog
2+
All notable changes to this project will be documented in this file.
3+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
4+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
5+
6+
## [Unreleased]

packages/bundle/CODE_OF_CONDUCT.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Microsoft Open Source Code of Conduct
2+
3+
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
4+
5+
Resources:
6+
7+
- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/)
8+
- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
9+
- Contact [[email protected]](mailto:[email protected]) with questions or concerns

packages/bundle/LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) Microsoft Corporation.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE

packages/bundle/README.md

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Kiota Bundle Library for PHP
2+
3+
![Build Status](https://github.com/microsoft/kiota-bundle-php/actions/workflows/build.yml/badge.svg)
4+
[![Latest Stable Version](https://poser.pugx.org/microsoft/kiota-bundle/version)](https://packagist.org/packages/microsoft/kiota-bundle)
5+
6+
The Kiota Bundle Library for PHP is the PHP library providing default implementations for client setup. The package provides a request adapter implementation with defaults serialization libraries setup fo use with a generated Kiota client.
7+
8+
Read more about Kiota [here](https://github.com/microsoft/kiota/blob/main/README.md).
9+
10+
## Using the Kiota Bundle Library for PHP
11+
12+
run `composer require microsoft/kiota-bundle` or add the following to your `composer.json` file:
13+
14+
```
15+
{
16+
"require": {
17+
"microsoft/kiota-bundle": "^1.5.0"
18+
}
19+
}
20+
```
21+
22+
23+
## Contributing
24+
25+
This project welcomes contributions and suggestions. Most contributions require you to agree to a
26+
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
27+
the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
28+
29+
When you submit a pull request, a CLA bot will automatically determine whether you need to provide
30+
a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions
31+
provided by the bot. You will only need to do this once across all repos using our CLA.
32+
33+
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
34+
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
35+
contact [[email protected]](mailto:[email protected]) with any additional questions or comments.
36+
37+
## Trademarks
38+
39+
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft
40+
trademarks or logos is subject to and must follow
41+
[Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general).
42+
Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.
43+
Any use of third-party trademarks or logos are subject to those third-party's policies.

packages/bundle/SECURITY.md

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<!-- BEGIN MICROSOFT SECURITY.MD V0.0.9 BLOCK -->
2+
3+
## Security
4+
5+
Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet) and [Xamarin](https://github.com/xamarin).
6+
7+
If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/security.md/definition), please report it to us as described below.
8+
9+
## Reporting Security Issues
10+
11+
**Please do not report security vulnerabilities through public GitHub issues.**
12+
13+
Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/security.md/msrc/create-report).
14+
15+
If you prefer to submit without logging in, send email to [[email protected]](mailto:[email protected]). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/security.md/msrc/pgp).
16+
17+
You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc).
18+
19+
Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
20+
21+
* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
22+
* Full paths of source file(s) related to the manifestation of the issue
23+
* The location of the affected source code (tag/branch/commit or direct URL)
24+
* Any special configuration required to reproduce the issue
25+
* Step-by-step instructions to reproduce the issue
26+
* Proof-of-concept or exploit code (if possible)
27+
* Impact of the issue, including how an attacker might exploit the issue
28+
29+
This information will help us triage your report more quickly.
30+
31+
If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/security.md/msrc/bounty) page for more details about our active programs.
32+
33+
## Preferred Languages
34+
35+
We prefer all communications to be in English.
36+
37+
## Policy
38+
39+
Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/security.md/cvd).
40+
41+
<!-- END MICROSOFT SECURITY.MD BLOCK -->

packages/bundle/SUPPORT.md

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# TODO: The maintainer of this repo has not yet edited this file
2+
3+
**REPO OWNER**: Do you want Customer Service & Support (CSS) support for this product/project?
4+
5+
- **No CSS support:** Fill out this template with information about how to file issues and get help.
6+
- **Yes CSS support:** Fill out an intake form at [aka.ms/onboardsupport](https://aka.ms/onboardsupport). CSS will work with/help you to determine next steps.
7+
- **Not sure?** Fill out an intake as though the answer were "Yes". CSS will help you decide.
8+
9+
*Then remove this first heading from this SUPPORT.MD file before publishing your repo.*
10+
11+
# Support
12+
13+
## How to file issues and get help
14+
15+
This project uses GitHub Issues to track bugs and feature requests. Please search the existing
16+
issues before filing new issues to avoid duplicates. For new issues, file your bug or
17+
feature request as a new Issue.
18+
19+
For help and questions about using this project, please **REPO MAINTAINER: INSERT INSTRUCTIONS HERE
20+
FOR HOW TO ENGAGE REPO OWNERS OR COMMUNITY FOR HELP. COULD BE A STACK OVERFLOW TAG OR OTHER
21+
CHANNEL. WHERE WILL YOU HELP PEOPLE?**.
22+
23+
## Microsoft Support Policy
24+
25+
Support for this **PROJECT or PRODUCT** is limited to the resources listed above.

packages/bundle/composer.json

+85
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
{
2+
"name": "microsoft/kiota-bundle",
3+
"description": "Default implementations for Kiota client setup",
4+
"version": "1.5.0",
5+
"type": "library",
6+
"license": "MIT",
7+
"authors": [
8+
{
9+
"name": "Microsoft Graph Client Tooling",
10+
"email": "[email protected]"
11+
}
12+
],
13+
"autoload": {
14+
"psr-4": {
15+
"Microsoft\\Kiota\\Bundle\\": "src/"
16+
}
17+
},
18+
"autoload-dev": {
19+
"psr-4": {
20+
"Microsoft\\Kiota\\Bundle\\Test\\": "tests/"
21+
}
22+
},
23+
"repositories": [
24+
{
25+
"type": "path",
26+
"url": "../abstractions",
27+
"options": {
28+
"symlink": false
29+
}
30+
},
31+
{
32+
"type": "path",
33+
"url": "../http/guzzle",
34+
"options": {
35+
"symlink": false
36+
}
37+
},
38+
{
39+
"type": "path",
40+
"url": "../serialization/json",
41+
"options": {
42+
"symlink": false
43+
}
44+
},
45+
{
46+
"type": "path",
47+
"url": "../serialization/form",
48+
"options": {
49+
"symlink": false
50+
}
51+
},
52+
{
53+
"type": "path",
54+
"url": "../serialization/multipart",
55+
"options": {
56+
"symlink": false
57+
}
58+
},
59+
{
60+
"type": "path",
61+
"url": "../serialization/text",
62+
"options": {
63+
"symlink": false
64+
}
65+
}
66+
],
67+
"require": {
68+
"php": "^7.4 || ^8.0",
69+
"microsoft/kiota-abstractions": "^1.4.0",
70+
"microsoft/kiota-http-guzzle": "^1.3.1",
71+
"microsoft/kiota-serialization-json": "^1.3.1",
72+
"microsoft/kiota-serialization-form": "^1.1.1",
73+
"microsoft/kiota-serialization-multipart": "^1.0.0",
74+
"microsoft/kiota-serialization-text": "^1.1.0"
75+
},
76+
"require-dev": {
77+
"phpunit/phpunit": "^9.6.22",
78+
"phpstan/phpstan": "^1.12.16"
79+
},
80+
"config": {
81+
"allow-plugins": {
82+
"php-http/discovery": false
83+
}
84+
}
85+
}

packages/bundle/phpstan.neon

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
parameters:
2+
level: 9
3+
polluteScopeWithAlwaysIterableForeach: false
4+
polluteScopeWithLoopInitialAssignments: false
5+
paths:
6+
- src

packages/bundle/phpunit.xml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit colors="true" bootstrap="vendor/autoload.php">
3+
<testsuites>
4+
<testsuite name="Kiota Guzzle Test Suite">
5+
<directory>tests</directory>
6+
</testsuite>
7+
</testsuites>
8+
<coverage pathCoverage="true">
9+
<include>
10+
<directory suffix=".php">src</directory>
11+
</include>
12+
<report>
13+
<html outputDirectory="coverage"/>
14+
</report>
15+
</coverage>
16+
<php>
17+
<ini name="memory_limit" value="500M" />
18+
</php>
19+
</phpunit>

0 commit comments

Comments
 (0)