Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v3 Upgrade: $excludesFile must be of type Phing\Io\File, string given #1890

Closed
linc opened this issue Dec 30, 2024 · 1 comment · Fixed by #1892
Closed

v3 Upgrade: $excludesFile must be of type Phing\Io\File, string given #1890

linc opened this issue Dec 30, 2024 · 1 comment · Fixed by #1892
Milestone

Comments

@linc
Copy link

linc commented Dec 30, 2024

After upgrading a working build to ^3, I now get this error:

BUILD FAILED
Phing\Type\PatternSet::setExcludesFile(): Argument #1 ($excludesFile) must be of type Phing\Io\File, string given,
 called in /Users/linc/code/porter/vendor/phing/phing/src/Phing/Type/AbstractFileSet.php on line 324

I run Phing from the repo root as ../vendor/bin/phing.

This is the top of my build.xml:

<?xml version="1.0" encoding="UTF-8"?>
<project name="nitro-porter" basedir="." default="main">
    <!-- Name the package folder. -->
    <property name="package" value="nitro-porter" override="true" />

    <!-- Parent directory of this file should be the root. -->
    <resolvepath file=".." propertyName="repo_root" />

    <!-- Define what's in the bundles. -->
    <fileset id="files" dir="${repo_root}" includesfile="file-allowlist.txt" excludesfile="file-denylist.txt" />

Both referenced text files are in the same folder as build.xml.

Screenshot 2024-12-30 at 9 41 04 AM

Deleting excludesfile="file-denylist.txt" from the fileset element allows the build to continue, which suggests this is specifically an exclusion problem, given the includes file works.

Leaving excludesfile="file-denylist.txt" and instead deleting the contents of file-denylist.txt yields the same error as above.

jawira added a commit to jawira/fork-phing that referenced this issue Dec 31, 2024
@jawira
Copy link
Contributor

jawira commented Dec 31, 2024

Hi I created a fix for this, I don't have time to write tests right now. Can somebody double check this fixes the issue please?

The PR also has tests.

#1892

jawira added a commit to jawira/fork-phing that referenced this issue Jan 5, 2025
jawira added a commit to jawira/fork-phing that referenced this issue Jan 5, 2025
mrook pushed a commit that referenced this issue Jan 15, 2025
* ComposerTask: update code & doc #1163

* fix: Add type to $excl parameter to fix type error

This fixes #1890

---------

Co-authored-by: Siad Ardroumli <siad.ardroumli@gmail.com>
@mrook mrook added this to the 3.1.0 milestone Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

3 participants